0

Hello;

I using the following sql to get information from two tables --through join;

/

/ this join works in sql, but can
$res = "select ad.firstname, ad.lastname, ad.address, ad.city, ad.state, ad.zipcode, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, ad.customerid, ad.servicedesc, aj.email,  aj.areacode, aj.phoneprefix, ad.clientID, 
aj.phonesufix, aj.cellareacode, aj.cellprefix, aj.cellsufix, aj.commentonclient from additional_cars as ad, ajax_client as aj where ad.clientID='$clientId' group by ad.clientID";

it works fine when tested in phpmyadmin, but fail we incorporated with the following which passes the value to another form using "formObj". here is the entire code:

function toSafeString($string) {
  $string = str_replace('<br/>', "\n", $string); 
   $string = preg_replace('/[\r\n]/s', '\\n', $string); 
  $string = str_replace(array('<br />','<br/>'),"\n",$string); 
     return $string;
   }
  
if(isset($_GET['getClientId'])){ 
  $clientId = preg_replace("/[^0-9|a-z|A-Z]/si", "", $_GET['getClientId']);

$res = "select ad.firstname, ad.lastname, ad.address, ad.city, ad.state, ad.zipcode, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, ad.customerid, ad.servicedesc, aj.email,  aj.areacode, aj.phoneprefix, ad.clientID, 
aj.phonesufix, aj.cellareacode, aj.cellprefix, aj.cellsufix, aj.commentonclient from additional_cars as ad, ajax_client as aj where ad.clientID='$clientId' group by ad.clientID";

  if($inf = mysql_fetch_array($res)){
    echo "formObj.firstname.value = '".toSafeString($inf["firstname"])."';\n";    
    echo "formObj.lastname.value = '".toSafeString($inf["lastname"])."';\n"; 
    echo "formObj.lastname1.value = '".toSafeString($inf["lastname"])."';\n";    
    echo "formObj.address.value = '".toSafeString($inf["address"])."';\n";    
    echo "formObj.zipcode.value = '".toSafeString($inf["zipcode"])."';\n";    
    echo "formObj.city.value = '".toSafeString($inf["city"])."';\n";    
    echo "formObj.state.value = '".toSafeString($inf["state"])."';\n";
    echo "formObj.dhtmlgoodies_category.value = '".toSafeString($inf["dhtmlgoodies_category"])."';\n";
    echo "formObj.dhtmlgoodies_subcategory.value = '".toSafeString($inf["dhtmlgoodies_subcategory"])."';\n";
    echo "formObj.caryear.value = '".toSafeString($inf["caryear"])."';\n";
    echo "formObj.servicedesc.value = '".toSafeString($inf["servicedesc"])."';\n"; 
    //echo "formObj.theDate.value = '".toSafeString($inf["theDate"])."';\n";
    //echo "formObj.areacode.value = '".toSafeString($inf["areacode"])."';\n";
    //echo "formObj.phoneprefix.value = '".toSafeString($inf["phoneprefix"])."';\n";
    //echo "formObj.phonesufix.value = '".toSafeString($inf["phonesufix"])."';\n"; 
    echo "formObj.email.value = '".toSafeString($inf["email"])."';\n"; 
    //echo "formObj.cellareacode.value = '".toSafeString($inf["cellareacode"])."';\n";
    //echo "formObj.cellprefix.value = '".toSafeString($inf["cellprefix"])."';\n";
    //echo "formObj.cellsufix.value = '".toSafeString($inf["cellsufix"])."';\n";
    echo "formObj.currentmileage.value = '".toSafeString($inf["currentmileage"])."';\n";
    //echo "formObj.Balancedue.value ='".toSafeString($inf["Balancedue"])."';\n";
   // echo "formObj.uploadedfile.value = '".$uploaddir.$inf["uploadedfile"]."';\n";//this includes directory and filename
    echo "formObj.servicearea.value = '".toSafeString($inf["servicearea"])."';\n";
    //echo "formObj.commentonclient.value = '".toSafeString($inf["commentonclient"])."';\n";
    echo "formObj.drivenmileage.value = '".toSafeString($inf["drivenmileage"])."';\n"; 
    echo "formObj.clientid.value = '".toSafeString($inf["clientID"])."';\n"; 
    //echo "formObj.clientid2.value = '".toSafeString($inf["clientID"])."';\n"; 
    echo "formObj.clientid3.value = '".toSafeString($inf["clientID"])."';\n"; 
    echo "formObj.displayname.value = '".toSafeString($inf["lastname"]).",".toSafeString($inf["firstname"])."';\n"; 
	echo "formObj.returnedClientId.value = '".toSafeString($inf["clientID"])."';\n";

  }
  else
  {
    echo "formObj.firstname.value = '';\n";    
    echo "formObj.lastname.value = '';\n";    
    echo "formObj.lastname1.value = '';\n";    
    echo "formObj.address.value = '';\n";    
    echo "formObj.zipcode.value = '';\n";    
    echo "formObj.city.value = '';\n";    
    echo "formObj.state.value = '';\n";
    echo "formObj.dhtmlgoodies_category.value = '';\n";
    echo "formObj.dhtmlgoodies_subcategory.value = '';\n";
    echo "formObj.caryear.value = '';\n";
    echo "formObj.servicedesc.value = '';\n";
    //echo "formObj.theDate.value = '';\n";
    //echo "formObj.areacode.value = '';\n";
    //echo "formObj.phoneprefix.value = '';\n";
    //echo "formObj.phonesufix.value = '';\n";
    echo "formObj.email.value = '';\n";
    //echo "formObj.cellareacode.value = '';\n";
    //echo "formObj.cellprefix.value = '';\n";
    //echo "formObj.cellsufix.value = '';\n";
    echo "formObj.currentmileage.value = '';\n";
    //echo "formObj.Balancedue.value = '';\n";
    echo "formObj.servicearea.value = '';\n";
    //echo "formObj.commentonclient.value = '';\n";
    echo "formObj.drivenmileage.value = '';\n";
    echo "formObj.clientid.value = '';\n";
    //echo "formObj.clientid2.value = '';\n";
    echo "formObj.clientid3.value = '';\n";
    echo "formObj.displayname.value = '';\n";
	echo "formObj.returnedClientId.value = '';\n";

        }    

}

works fine if I'm querying one table, but problem comes about when joining the tables. any thoughts as to why?

Thanks

Edited by mbarandao: n/a

4
Contributors
24
Replies
25
Views
6 Years
Discussion Span
Last Post by ddymacek
0

your code:

$res = "select ad.firstname, ad.lastname, ad.address, ad.city, ad.state, ad.zipcode, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, ad.customerid, ad.servicedesc, aj.email, aj.areacode, aj.phoneprefix, ad.clientID,
aj.phonesufix, aj.cellareacode, aj.cellprefix, aj.cellsufix, aj.commentonclient from additional_cars as ad, ajax_client as aj where ad.clientID='$clientId' group by ad.clientID";
 
if($inf = mysql_fetch_array($res)){ ...

2 questions what is $inf, and where are you actually executing your query?

$result = mysql_query($res);

// this will never be true according to the above code
if($inf = mysql_fetch_array($res))
0

your code:

$res = "select ad.firstname, ad.lastname, ad.address, ad.city, ad.state, ad.zipcode, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, ad.customerid, ad.servicedesc, aj.email, aj.areacode, aj.phoneprefix, ad.clientID,
aj.phonesufix, aj.cellareacode, aj.cellprefix, aj.cellsufix, aj.commentonclient from additional_cars as ad, ajax_client as aj where ad.clientID='$clientId' group by ad.clientID";
 
if($inf = mysql_fetch_array($res)){ ...

2 questions what is $inf, and where are you actually executing your query?

$result = mysql_query($res);

// this will never be true according to the above code
if($inf = mysql_fetch_array($res))

Thanks for the reply, the query is executed on an associated form through the the following jquery script:

var currentClientID = false;
function getClientData() {
	var clientId = $('#clientID').val().replace(/[^0-9|a-z|A-Z]/g,'');//here to incorporate the client id with numbers and letters
	if(clientId.length >0 && clientId!=currentClientID){//here to change the client id length
		$.ajax({
			url: 'getclient.php?getClientId=' + clientId,
			type: "GET",
			success: function showClientData(response) {
				var formObj = document.forms["clientForm"];
				eval(response);
				currentClientID = clientId;
			}
		});
	}
}

the values are passed to a form barring the same name and id of the values in the query.

So essentially:

<input name="lastname" id="lastname" size="20" maxlength="255" disabled="true"></td>
 receives value from
 echo "formObj.firstname.value = '".toSafeString($inf["firstname"])."';\n";

The concept is based on the work I found on DTHMLGoodies.com and escalated the concept a bit further.

Edited by mbarandao: n/a

0

is there an error in the query? can you call

query or die (mysql_error());

can you echo out your sql before submitting to db. is it correct?

I'm very curious as to what your $res is holding, if anything at all.
I see the clientId coming from your form using as request, I understand all of that.
But I never see your actual query to the database that should look something like this.

$result = mysql_query($res);
// then your $inf line would be 
if($inf = mysql_fetch_array($result)){  // and you should have data
0

There is no error. When echoed the sql is not printed. But the sql by itself in phpmyadmin works as expected

0

ok. We're not quite seeing eye to eye here.
question: is the 81 lines of php everything that is in the getclient.php code?
Are you connecting to a db at all? you don't have to show any connection code, but I am just curious.
you have to log in to your db.
you then set your sql syntax.
you then execute your sql.
you then 'normally' do something with results.
So while it all may be in your code, I am not seeing the following things:
For me this is my normal 'connection' code. I think the main part of your code looks fine... except I see no db connections in your code.

/*  Define your db params prior to their use */
	define(DB_HOST,'localhost');
	define(DB_USER,'username');
	define(DB_PASS,'password');
	define(DB_BASE,'database_name');

	// placeholder for dblink
	$dblink = null;
	try	{
		// connect to your database as defined above, or die spewing error message.
		$dblink = mysql_connect(DB_HOST,DB_USER,DB_PASS) or die(mysql_error());
		// change to your selected database that you want to use.
		mysql_select_db(DB_BASE,$dblink);
	} catch(Exception $ex) {
		echo "Could not connect to " . DB_HOST . ":" . DB_BASE . "\n";
		echo "Error: " . $ex->message;
		exit;
	}
	// define your sql syntax (change the query to be your "$res" statement)		
	$sql =  "SELECT * FROM x WHERE y = '".$this->slashes($id)."'";

	/****    note ***/
	  this is where I meant to echo out your sql.  you said "When echoed the sql is not printed"
	  I'm guessing you mean your result, which I don't think you are ever even hitting your database.
	  what I meant was echo out your "$res" statement, and see if $clientID was properly set.
	  so: to 'echo sql'  echo "MY SQL = " . $sql . "<br />";
	/**** end note ***/
	   echo "MY SQL = " . $sql . "<br />";
	// actually execute your query to the db, or die spewing error message.
	$res = mysql_query($sql,$dblink) or die(mysql_error());
	// also calling query this way with die will send out an error message if there is something wrong with your syntax or connection.

	/************** 
	  now you should have some returned results...  
	**************/

	if ($inf = mysql_fetch_array($res)) {	
	} else {
		// set your blank vars
	}
	finally close the database connection.
	if(is_resource($dblink)) {		
		mysql_close($dblink);
	}

Does this make sense. I don't think you are ever connecting to your database, as opposed to there being an error in your syntax.

0

ok. We're not quite seeing eye to eye here.
question: is the 81 lines of php everything that is in the getclient.php code?
Are you connecting to a db at all? you don't have to show any connection code, but I am just curious.
you have to log in to your db.
you then set your sql syntax.
you then execute your sql.
you then 'normally' do something with results.
So while it all may be in your code, I am not seeing the following things:
For me this is my normal 'connection' code. I think the main part of your code looks fine... except I see no db connections in your code.

/*  Define your db params prior to their use */
	define(DB_HOST,'localhost');
	define(DB_USER,'username');
	define(DB_PASS,'password');
	define(DB_BASE,'database_name');

	// placeholder for dblink
	$dblink = null;
	try	{
		// connect to your database as defined above, or die spewing error message.
		$dblink = mysql_connect(DB_HOST,DB_USER,DB_PASS) or die(mysql_error());
		// change to your selected database that you want to use.
		mysql_select_db(DB_BASE,$dblink);
	} catch(Exception $ex) {
		echo "Could not connect to " . DB_HOST . ":" . DB_BASE . "\n";
		echo "Error: " . $ex->message;
		exit;
	}
	// define your sql syntax (change the query to be your "$res" statement)		
	$sql =  "SELECT * FROM x WHERE y = '".$this->slashes($id)."'";

	/****    note ***/
	  this is where I meant to echo out your sql.  you said "When echoed the sql is not printed"
	  I'm guessing you mean your result, which I don't think you are ever even hitting your database.
	  what I meant was echo out your "$res" statement, and see if $clientID was properly set.
	  so: to 'echo sql'  echo "MY SQL = " . $sql . "<br />";
	/**** end note ***/
	   echo "MY SQL = " . $sql . "<br />";
	// actually execute your query to the db, or die spewing error message.
	$res = mysql_query($sql,$dblink) or die(mysql_error());
	// also calling query this way with die will send out an error message if there is something wrong with your syntax or connection.

	/************** 
	  now you should have some returned results...  
	**************/

	if ($inf = mysql_fetch_array($res)) {	
	} else {
		// set your blank vars
	}
	finally close the database connection.
	if(is_resource($dblink)) {		
		mysql_close($dblink);
	}

Does this make sense. I don't think you are ever connecting to your database, as opposed to there being an error in your syntax.

My apology, I do have an include database connection file within the file. I'm able to connect to db and process the request without problem when I'm only querying one table.

Though my connection is note as elabarate as yours, but the following is included

$connection = mysql_connect("host","username","password");  
mysql_select_db("databaseName",$connection);

I'll give your re-write a try and advise shortly.

Thanks, I appreciate your time on this.

Mossa

0

I have modified according to the your suggestion, unfortunately, same outcome as my initial code. No data is pulled, nor I'm getting any errors. Also, unable to echo as instructed. Any thoughts!

Here is the complete code:

<?php
 function toSafeString($string) {
  $string = str_replace('<br/>', "\n", $string); 
   $string = preg_replace('/[\r\n]/s', '\\n', $string); 
  $string = str_replace(array('<br />','<br/>'),"\n",$string); 
     return $string;
   }
if(isset($_GET['getClientId'])){ 
  $clientId = preg_replace("/[^0-9|a-z|A-Z]/si", "", $_GET['getClientId']);

/*  Define your db params prior to their use */
	define(DB_HOST,'******');
	define(DB_USER,'****');
	define(DB_PASS,'*****');
	define(DB_BASE,'*******');

	// placeholder for dblink
	$dblink = null;
	try	{
		// connect to your database as defined above, or die spewing error message.
		$dblink = mysql_connect(DB_HOST,DB_USER,DB_PASS) or die(mysql_error());
		// change to your selected database that you want to use.
		mysql_select_db(DB_BASE,$dblink);
	} catch(Exception $ex) {
		echo "Could not connect to " . DB_HOST . ":" . DB_BASE . "\n";
		echo "Error: " . $ex->message;
		exit;
	}

	$sql ="SELECT ad.firstname, ad.lastname, ad.address, ad.city, ad.state, ad.zipcode, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, ad.customerid, ad.servicedesc, aj.email,  aj.areacode, aj.phoneprefix, ad.clientID, 
	aj.phonesufix, aj.cellareacode, aj.cellprefix, aj.cellsufix, aj.commentonclient FROM additional_cars as ad, ajax_client as aj WHERE ad.clientID='$clientId' group by ad.clientID"; //y = '".$this->slashes($id)."'";

	 echo "MY SQL = " . $sql . "<br />";
	// actually execute your query to the db, or die spewing error message.
	$res = mysql_query($sql,$dblink) or die(mysql_error());
	// also calling query this way with die will send out an error message if there is something wrong with your syntax or connection.

	/************** 
	  now you should have some returned results...  
	**************/

	if ($inf = mysql_fetch_array($res)) 
	{	
	echo "formObj.firstname.value = '".toSafeString($inf["firstname"])."';\n";    
    echo "formObj.lastname.value = '".toSafeString($inf["lastname"])."';\n"; 
    echo "formObj.lastname1.value = '".toSafeString($inf["lastname"])."';\n";    
    echo "formObj.address.value = '".toSafeString($inf["address"])."';\n";    
    echo "formObj.zipcode.value = '".toSafeString($inf["zipcode"])."';\n";    
    echo "formObj.city.value = '".toSafeString($inf["city"])."';\n";    
    echo "formObj.state.value = '".toSafeString($inf["state"])."';\n";
    echo "formObj.dhtmlgoodies_category.value = '".toSafeString($inf["dhtmlgoodies_category"])."';\n";
    echo "formObj.dhtmlgoodies_subcategory.value = '".toSafeString($inf["dhtmlgoodies_subcategory"])."';\n";
    echo "formObj.caryear.value = '".toSafeString($inf["caryear"])."';\n";
    echo "formObj.servicedesc.value = '".toSafeString($inf["servicedesc"])."';\n"; 
    //echo "formObj.theDate.value = '".toSafeString($inf["theDate"])."';\n";
    //echo "formObj.areacode.value = '".toSafeString($inf["areacode"])."';\n";
    //echo "formObj.phoneprefix.value = '".toSafeString($inf["phoneprefix"])."';\n";
    //echo "formObj.phonesufix.value = '".toSafeString($inf["phonesufix"])."';\n"; 
    echo "formObj.email.value = '".toSafeString($inf["email"])."';\n"; 
    //echo "formObj.cellareacode.value = '".toSafeString($inf["cellareacode"])."';\n";
    //echo "formObj.cellprefix.value = '".toSafeString($inf["cellprefix"])."';\n";
    //echo "formObj.cellsufix.value = '".toSafeString($inf["cellsufix"])."';\n";
    echo "formObj.currentmileage.value = '".toSafeString($inf["currentmileage"])."';\n";
    //echo "formObj.Balancedue.value ='".toSafeString($inf["Balancedue"])."';\n";
   // echo "formObj.uploadedfile.value = '".$uploaddir.$inf["uploadedfile"]."';\n";//this includes directory and filename
    echo "formObj.servicearea.value = '".toSafeString($inf["servicearea"])."';\n";
    //echo "formObj.commentonclient.value = '".toSafeString($inf["commentonclient"])."';\n";
    echo "formObj.drivenmileage.value = '".toSafeString($inf["drivenmileage"])."';\n"; 
    echo "formObj.clientid.value = '".toSafeString($inf["clientID"])."';\n"; 
    //echo "formObj.clientid2.value = '".toSafeString($inf["clientID"])."';\n"; 
    echo "formObj.clientid3.value = '".toSafeString($inf["clientID"])."';\n"; 
    echo "formObj.displayname.value = '".toSafeString($inf["lastname"]).",".toSafeString($inf["firstname"])."';\n"; 
	echo "formObj.returnedClientId.value = '".toSafeString($inf["clientID"])."';\n";

	} 
	else {
		echo "formObj.firstname.value = '';\n";    
    echo "formObj.lastname.value = '';\n";    
    echo "formObj.lastname1.value = '';\n";    
    echo "formObj.address.value = '';\n";    
    echo "formObj.zipcode.value = '';\n";    
    echo "formObj.city.value = '';\n";    
    echo "formObj.state.value = '';\n";
    echo "formObj.dhtmlgoodies_category.value = '';\n";
    echo "formObj.dhtmlgoodies_subcategory.value = '';\n";
    echo "formObj.caryear.value = '';\n";
    echo "formObj.servicedesc.value = '';\n";
    //echo "formObj.theDate.value = '';\n";
    //echo "formObj.areacode.value = '';\n";
    //echo "formObj.phoneprefix.value = '';\n";
    //echo "formObj.phonesufix.value = '';\n";
    echo "formObj.email.value = '';\n";
    //echo "formObj.cellareacode.value = '';\n";
    //echo "formObj.cellprefix.value = '';\n";
    //echo "formObj.cellsufix.value = '';\n";
    echo "formObj.currentmileage.value = '';\n";
    //echo "formObj.Balancedue.value = '';\n";
    echo "formObj.servicearea.value = '';\n";
    //echo "formObj.commentonclient.value = '';\n";
    echo "formObj.drivenmileage.value = '';\n";
    echo "formObj.clientid.value = '';\n";
    //echo "formObj.clientid2.value = '';\n";
    echo "formObj.clientid3.value = '';\n";
    echo "formObj.displayname.value = '';\n";
	echo "formObj.returnedClientId.value = '';\n";
	}
	//finally close the database connection.
	if(is_resource($dblink)) {		
		mysql_close($dblink);
	}
	}
?>
0

after running page view souce and search for MY SQL =
I think you should find real query text around it in source. then run that query in myadmin.

0

after running page view souce and search for MY SQL =
I think you should find real query text around it in source. then run that query in myadmin.

urtrivedi, thanks for your post. I'm afraid I'm not following your suggestion. Can you please clarify?

I have tested the sql inside phpmyadmin. It works fine!

Mossa--

Edited by mbarandao: n/a

0

when you run this page in browser, then, if you right click on broswer, it will show VIEW SOURCE OPTION (THAT WILL SHOW HTML CODE). depending on browser one or another way you will find such menu.

when you loook at html code in search text type MY SQL =

then following you will find query, copy it then run it in phpymadmin
this is to check whether your php page is builing query properly or not

0

I have tested this code, its running fine here
make sure you pass getClientId and your post method is get, Be sure about case sensitivity of variable name C and I should be capital and rest letters in small

when I open link

http://server/folder/page.php?getClientId=DG9642

It gives following output

MY SQL = SELECT ad.firstname, ad.lastname, ad.address, ad.city, ad.state, ad.zipcode, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, ad.customerid, ad.servicedesc, aj.email, aj.areacode, aj.phoneprefix, ad.clientID, aj.phonesufix, aj.cellareacode, aj.cellprefix, aj.cellsufix, aj.commentonclient FROM additional_cars as ad, ajax_client as aj WHERE ad.clientID='DG9642' group by ad.clientID
formObj.firstname.value = 'Mossa'; formObj.lastname.value = 'Barandao'; formObj.lastname1.value = 'Barandao'; formObj.address.value = '6572 Park Fifth Ave'; formObj.zipcode.value = '22384'; formObj.city.value = 'New York'; formObj.state.value = 'NY'; formObj.dhtmlgoodies_category.value = 'JAGUAR'; formObj.dhtmlgoodies_subcategory.value = 'X-TYPE'; formObj.caryear.value = '1988'; formObj.servicedesc.value = '\nOn June 30, 2011, 9:55 am\nWe performed the following:\nServiced Area: Exhaust \nService Details:\n\nexshaust\n\nMileage @ Service: 4334\n\n----End of Service Report----\n\nOn June 24, 2011, 2:48 pm\nWe performed the following:\nServiced Area: Driveshaft & Axle \nService Details:\n\ntest\n\nMileage @ Service: 5634\n\n----End of Service Report----\n\nOn June 22, 2011, 4:39 pm\nWe performed the following:\nServiced Area: Clutch , Driveshaft & Axle , Suspension \nService Details:\n\ntest\n\nMileage @ Service: 6377\n\n----End of Service Report----\n\nOn June 21, 2011, 12:31 pm\nWe performed the following:\nServiced Area: Air Intake , Brake , Oil Change , Engine Mechanical , Steering , Transmission \nService Details:\n\ntest\n\nMileage @ Service: 4343\n\n----End of Service Report----\n\nOn June 20, 2011, 11:05 am\nWe performed the following:\nServiced Area: Clutch , Engine Mechanical , Steering \nService Details:\n\ntest\n\nMileage @ Service: 4343\n\n----End of Service Report----\n\nOn April 18, 2011, 9:43 am\nWe performed the following:\nServiced Area: Driveshaft & Axle , Engine Mechanical \nService Details:\n\ntest\n\nMileage @ Service: 54\n\n----End of Service Report----\n\nOn April 16, 2011, 7:08 pm\nWe performed the following:\nServiced Area: Air Intake , Brake , Driveshaft & Axle , Engine Mechanical \nService Details:\n\nTest\n\nMileage @ Service: 657\n\n----End of Service Report----\n\nOn April 10, 2011, 6:04 pm\nWe performed the following:\nServiced Area: Exhaust \nService Details:\n\ntest\n\nMileage @ Service: 5433\n\n----End of Service Report----\n\nOn April 10, 2011, 5:00 pm\nWe performed the following:\nServiced Area: Cooling System , Engine Mechanical \nService Details:\n\ntest\n\nMileage @ Service: 54545\n\n----End of Service Report----\n\nOn April 10, 2011, 4:59 pm\nWe performed the following:\nServiced Area: Cooling System , Engine Mechanical \nService Details:\n\ntest\n\nMileage @ Service: 54545\n\n----End of Service Report----\n\nOn April 10, 2011, 4:51 pm\nWe performed the following:\n\nAdded Vehicle Profile to this account\n\n----End of Service Report----\n'; formObj.email.value = 'mbarandao@thembainc.org'; formObj.currentmileage.value = ''; formObj.servicearea.value = ''; formObj.drivenmileage.value = ''; formObj.clientid.value = 'DG9642'; formObj.clientid3.value = 'DG9642'; formObj.displayname.value = 'Barandao,Mossa'; formObj.returnedClientId.value = 'DG9642';

Edited by urtrivedi: n/a

0

can you drop a

print_r($res); or var_dump($res);

on line 37 and tell us results.
is there anything in the error message?
I know you've said before, but can you run a straight simple
select * from x
and see if you have anything in $res.
I'm trolling the web looking for similar issues. This one I have not dealt with before, and the lack of error messages and data is confusing.

0

can you drop a

print_r($res); or var_dump($res);

on line 37 and tell us results.
is there anything in the error message?
I know you've said before, but can you run a straight simple
select * from x
and see if you have anything in $res.
I'm trolling the web looking for similar issues. This one I have not dealt with before, and the lack of error messages and data is confusing.

Thanks for the reply; I have added

print_r($res);

, still the same outcome. Also, I'm not successful either with just a straight "select * from x".

Testing the code as suggested by urtrivedi, through a link ie:

page.php?getClientId=D932DG

gives this output:

MY SQL = SELECT ad.firstname, ad.lastname, ad.address, ad.city, ad.state, ad.zipcode, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, ad.customerid, ad.servicedesc, aj.email, aj.areacode, aj.phoneprefix, ad.clientID, aj.phonesufix, aj.cellareacode, aj.cellprefix, aj.cellsufix, aj.commentonclient FROM additional_cars as ad, ajax_client as aj WHERE ad.clientID='9932dg' and ad.customerid=aj.customerid group by ad.clientID
resource(2) of type (mysql result) formObj.firstname.value = 'Paul'; formObj.lastname.value = 'Johnson'; formObj.lastname1.value = 'Johnson'; formObj.address.value = '2040 W Virginia Avenue NE'; formObj.zipcode.value = '23873'; formObj.city.value = 'Washington'; formObj.state.value = 'DC'; formObj.dhtmlgoodies_category.value = 'FORD'; formObj.dhtmlgoodies_subcategory.value = 'E150 CLUB WAGON'; formObj.caryear.value = '2006'; formObj.servicedesc.value = '\nOn July 23, 2011, 7:19 am\nWe performed the following:\nServiced Area: Oil Change \nService Details:\n\ntest\n\nMileage @ Service: 4453\n\n----End of Service Report----\n\nOn July 22, 2011, 9:38 pm\nWe performed the following:\nServiced Area: Oil Change \nService Details:\n\noil change\n\nMileage @ Service: 2345\n\n----End of Service Report----\n\nOn July 7, 2011, 11:22 am\nWe performed the following:\n\nAdded Vehicle Profile to this account\n\n----End of Service Report----\n'; formObj.theDate.value = ''; formObj.email.value = 'pauljohnson@aol.com'; formObj.currentmileage.value = ''; formObj.servicearea.value = ''; formObj.drivenmileage.value = ''; formObj.clientid.value = '9932DG'; formObj.clientid3.value = '9932DG'; formObj.displayname.value = 'Johnson,Paul'; formObj.returnedClientId.value = '9932DG';

This indicates that the sql and the db connection is working fine; but the main issue is: I'm not able to get these variables into the receiving form --on which the ajax function is coded.

Again, here is the ajax:

var currentClientID = false;
function getClientData() {
	var clientId = $('#clientID').val().replace(/[^0-9|a-z|A-Z]/g,'');//here to incorporate the client id with numbers and letters
	if(clientId.length >0 && clientId!=currentClientID){//here to change the client id length
		$.ajax({
			url: 'getclient.php?getClientId=' + clientId,
			type: "GET",
			success: function showClientData(response) {
				var formObj = document.forms["clientForm"];
				eval(response);
				currentClientID = clientId;
			}
		});
	}
}

I'm suppose to get the variables in form field like:

<input name="firstname" id="firstname" size="20" maxlength="255" disabled="true">

Your thoughts!
Mossa

0

Now you know that your script is giving code, so now stop echoing sql and other variables only you should echo javascript statement, because when u eval(response), it will expect javascript code not any other. so comment unwanted things.

also you upload your whole form page that is having ajax funtion here, I will give a try.

0

Thanks for the follow-up. the form page is a bit extensive --about 700 lines. I'll attach.

thanks...

Attachments
<?php
include('auth.php');
//$username=$_REQUEST['username'];
$username =$_SESSION['SESS_LOG_IN']; 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title><?php include ('page_title.php');?></title>
<style type="text/css">
body {
	background-repeat:no-repeat;
	font-family: Trebuchet MS, Lucida Sans Unicode, Arial, sans-serif;
	height: 100%;
	background-color: #C0C0C0;
	margin: 6px auto;
	padding: 0;
	background-image: url;
	background-repeat: no-repeat;
	padding-top: 85px;
}
.center{width:1060px;margin:0 auto;}

fieldset {
	width:500px;
	margin-left:10px;
}


#servicedesc {
	position: absolute;
	top: 260px;
	right: 13px;
	padding-right: 0px;
	width: 499px;
	height: 195px;
	color: #FF0000;//#99CC00;
	vertical-align: top;
	text-align: left;
	background-color: #FDFCDC;
	padding-bottom: 0px;
	z-index: 10;
	/* border: 1px dotted #FDFCDC; */
}
a:hover {
	color: #0000FF;//#99CC00;
}
#menuoption {
	position: absolute;
	top: 770px;
	right: 250px;
	padding-right: 0px;
	width: 470px;
	height: 10px;
	vertical-align: top;
	text-align: center;
	background-color: ;
	padding-bottom: 0px;
	z-index: 10;
	/* border: 1px dotted #FDFCDC; */
}
#home {
    position: absolute;
    top: 770px;
    right: 200px;
    padding-right: 0px;
    width: 45px;
    height: 45px;
    vertical-align: top;
    text-align: center;
    background: url(images/homepage_icon.png) no-repeat;
    padding-bottom: 0px;
    z-index: 10;
 }
#home:hover {
   				background-position:;
  				background-image:url(images/homepage_icon_hover.png);
} 
 
#logos {
	position: absolute;
	top: 740px;
	right: 10px;
	padding-right: 0px;
	width: 200px;
	height: 75px;
	vertical-align: top;
	text-align: center;
	padding-bottom: 0px;
	z-index: 10;
}

#instruct {
	position: absolute;
	top: 730px;
	left: 10px;
	padding-right: 0px;
	width: 350px;
	height: 90px;
	vertical-align: top;
	text-align: left;
	background-color: #EBEBEB ;
	padding-bottom: 0px;
	font: bold 12px Verdana, Arial, Helvetica, sans-serif;
	z-index: 0;
	border: 2px solid #FFFAF0;
}
h5 {
	color: #FF0000;//#99CC00;
	margin: 0px 0px 5px;
	padding: 0px 0px 3px;
	font: bold 14px Verdana, Arial, Helvetica, sans-serif;
	border-bottom: 1px dashed #E6E8ED;
}
.myspan2 {
	display: block;
	position: absolute;
	top: -32px;
	left: 490px;
	width:20px;
	height:20px;
	vertical-align: center;
	border-style: outset;
	background-color: red;
}
#baldue {
	position: absolute;
	top: 645px;
	left: 13px;
	padding-right: 0px;
	width: 200px;
	height: 20px;
	vertical-align: top;
	text-align: left;
	padding-bottom: 0px;
	/* border: 1px  #6495ED; */
	z-index: 10;
}
#livesearch {
	position: absolute;
	top: 660px;
	left: 13px;
	padding-right: 0px;
	width: 580px;
	height: 20px;
	vertical-align: top;
	text-align: left;
	background-color:transparent;
	padding-bottom: 0px;
	z-index: 10;
}
#oilchangedate {
	position: absolute;
	top: 660px;
	left: 320px;
	padding-right: 0px;
	width: 220px;
	height: 20px;
	vertical-align: top;
	text-align: left;
	padding-bottom: 0px;
	/* border: 1px  #6495ED; */
	z-index: 10;
}

#livesearch2 {
	position: absolute;
	top: 680px;
	left: 320px;
	padding-right: 0px;
	width: 257px;
	height: 25px;
	vertical-align: top;
	text-align: left;
	background-color:#00FFFF;
	padding-bottom: 0px;
	border: inset 2px white;
	/* border: 1px  #6495ED; */
	z-index: 10;
}
#livesearch3 {
	position: absolute;
	top: 760px;
	left: 392px;
	padding-right: 0px;
	width: 480px;
	height: 45px;
	vertical-align: middle;
	text-align: center;
	/*background-color:#00FFFF;*/
	padding-bottom: 0px;
	border: inset 5px white;
	/* border: 1px  #6495ED; */
	z-index: 10;
}
#emailicon {
	position: absolute;
	top: 670px;
	left: 240px;
	padding-right: 0px;
	width: 40px;
	height: 40px;
	vertical-align: top;
	text-align: right;
	background: url(images/emailicon2.png) no-repeat;
	padding-bottom: 0px;
	/* border: inset 2px white; */
	/* border: 1px  #6495ED; */
	z-index: 10;
}
#emailicon:hover {
	background-position:;
	background-image:url(images/emailicon3.png);
}
#hidden {
	position: absolute;
	top: 666px;
	left: 13px;
	padding-right: 0px;
	width: 200px;
	height: 10px;
	vertical-align: top;
	text-align: left;
	background-color: transparent;
	padding-bottom: 0px;
	z-index: 10;
}
#blankbox {
	position: absolute;
	top: 666px;
	left: 13px;
	padding-right: 0px;
	width: 125px;
	height: 25px;
	vertical-align: top;
	text-align: left;
	background-color: red;
	padding-bottom: 0px;
	border: inset 2px white;
	z-index: 10;
}
/*
#hidden2 {
	position: absolute;
	top: 666px;
	left: 13px;
	padding-right: 0px;
	width: 200px;
	height: 10px;
	vertical-align: top;
	text-align: left;
	//background-color: red;
	padding-bottom: 0px;
	z-index: 10;
}
*/
#hidden3 {
	position: absolute;
	top: 666px;
	left: 13px;
	padding-right: 0px;
	width: 200px;
	height: 10px;
	vertical-align: top;
	text-align: left;
 	color: #BEBEBE;
 	/* background-color: red; */
	padding-bottom: 0px;
	z-index: 10;
}

#separating-line {
	position: absolute;
	top: 2px;
	right: 530px;
	padding-right: 0px;
	width: 1px;
	height: 445px;
	background-color: #000000;
	border-style: inset;
	/* vertical-align: top; */
	/* border: 2px  #6495ED; */
}
a.button {
	text-decoration: none;
	padding: 3px 5px;
	background-color: white;
	border: outset 3px silver;
	font: normal 12px arial, sans-serif;
	color: blue;
}
a.button:active {
	background-position: right;
	color: #777;
	outline: blue; /* hide dotted outline in Firefox */
}
a.button:active span {
	background-position: bottom right;
	padding: 15px 0 10px 15px; /* push text down 4px */
}
a.button:hover {
	background-position: bottom right;
	color: #172;
	outline: red; /* hide dotted outline in Firefox */
	}
#companyname_holder {
                  position: absolute;
                  top: 70px;
                  right: 0px;
                  padding-right: 0px;
				  vertical-align: right;
                  background-color:;
                  padding-left:;
                  /*margin:auto;*/
                  z-index: 10px;
                           }

</style>
<!--<link rel="stylesheet" type="text/css" href="AJAX/jquery.autocomplete.css" />-->
<link rel="stylesheet" type="text/css" href="jquery/autocomplete/jquery.autocomplete.css" />
<!--<link rel="stylesheet" type="text/css" href="jquery/autocomplete/jquery.autocomplete.css" />-->

<script>
if (parent.location != location) parent.location.href = location.href;

document.onkeypress = function(evt) {//stopRKey;
	var evt = evt || window.event;
	var node = evt.target || evt.srcElement;
	if ((evt.keyCode == 13) && (node.type=="text")) { return false; }
};
</script>

<!--script type="text/javascript" src="/AJAX/ajax.js"></script-->
<!--script  src="jquery/autocomplete/jquery.autocomplete.js"></script-->
<!--script src="jquery/autocomplete/jquery.js"></script-->
<!--script src="jquery/jqueryui/js/jquery-ui-1.8.9.custom.min.js"></script-->
<!--script src="jquery/autocomplete/jquery.autocomplete.min.js"></script-->
<script src="jquery/jqueryui/js/jquery-1.4.4.min.js"></script>
<script src='jquery/autocomplete/jquery.autocomplete.js'></script>
<script type="text/javascript">
/************************************************************************************************************
	Ajax client lookup
	Copyright (C) 2006  DTHMLGoodies.com, Alf Magne Kalleland

	Alf Magne Kalleland, 2006
	Owner of DHTMLgoodies.com

************************************************************************************************************/
var currentClientID = false;
function getClientData() {
	var clientId = $('#clientID').val().replace(/[^0-9|a-z|A-Z]/g,'');//here to incorporate the client id with numbers and letters
	if(clientId.length >0 && clientId!=currentClientID){//here to change the client id length
		$.ajax({
			url: 'getclient.php?getClientId=' + clientId,
			type: "GET",
			success: function showClientData(response) {
				var formObj = document.forms["clientForm"];
				eval(response);
				currentClientID = clientId;
			}
		});
	}
}

<!--Script for displaying image-->
function showHint(str) {
	var $element = $("#txtHint");
	if (str.length==0) {
		$element.html('');
		return;
	}
	$.ajax({
		url: "getimage.php?q=" + str,
		type: "GET",
		success: function(response) {
			$element.html(response);
		}
	});
}

<!-- for passing variable to processing center-->
function showResult3(strss, username) {
	var $element = $('#livesearch3');
	if (strss.length==0) {
		$element.html('Menu Options is Displayed here on client Information Retrieval!');
//		$element.css('border', '0px');
		return;
	}
//	var newclientid = document.clientForm.clientid3.value;
	$.ajax({
		url: "getvariables_new.php?q=" + strss,
		type: "GET",
		success: function(response) {
			$element.html(response);
//			$element.css('border', '1px solid #A5ACB2');
		}
	});
}

<!--Script for displaying balacnce-->
function showResult(str) {
	var $element = $('#livesearch');
	if (str.length==0) {
		$element.html('');
		//$element.css('border', '2px');
		return;
	}
	$.ajax({
		url: "getbaloilhistory.php?q=" + str,
		type: "GET",
		success: function(response) {
			$element.html(response);
			//$element.css.('border', '1px solid #A5ACB2');
		}
	});
}

$(document).ready(function() {
	<!-- for auto suggest for typing license plate number-->
	$("#clientID").autocomplete("autocomplete_list.php", {
		width: 260,
		matchContains: true,
		selectFirst: false
			}).keyup(function() {
		showHint(this.value);//invokes showHint on population--no keyboard action required
	}).blur(function() {
		getClientData();
		showResult(this.value);//invokes showHint on population--no keyboard action required
		showResult3(this.value);//invokes showHint on population--no keyboard
0

I am not able to trace, but I think you must separate clientdata calling from other part.
call it separately.

Also eval() is also not working. so you must find another way of setting html elements other than eval.
I have never used jquery -ajax so I am not able to debug it,
For ajax i use XAJAX libraries

0

A valiant effort; thank you! I have always had issue with this concept of performing a client-look up. I think it is time to construct a much more efficient and less problematic process.

So I'm moving away from it.

Again, I appreciate the many suggestions.

Mossa

0

Mossa, have you ever considered using classes. They are efficient and very useful. When I get a moment I will try to construct you a 'client' class, which you could use within you php scripts. I'm a big fan of classes and separating php logic code, from html code. I'll get back to you in a couple of hours.

0

Mossa, have you ever considered using classes. They are efficient and very useful. When I get a moment I will try to construct you a 'client' class, which you could use within you php scripts. I'm a big fan of classes and separating php logic code, from html code. I'll get back to you in a couple of hours.

Very kind of you , dymacek! I have not considered classes and my knowledge of it is somewhat lacking. I appreciate some guidance. I'll certainly begin looking into it as well.

Again, thank you for your continued assistance!
Mossa--

0

mbarandao I've figured out my ajax call.
What exactly are you trying to do?
What are you wanting to do with client data when looked up.
Are we supposed to automatically fill in all of the relevant form fields with client data?
you said....
"I'm suppose to get the variables in form field like:

PHP Syntax (Toggle Plain Text)

<input name="firstname" id="firstname" size="20" maxlength="255" disabled="true">

"
is the return client data supposed to be a new form, or are you wanting to populate your 'clientForm' form on client_retrieval_Mossa from data retrieved from getclient.php?

0

mbarandao I've figured out my ajax call.
What exactly are you trying to do?
What are you wanting to do with client data when looked up.
Are we supposed to automatically fill in all of the relevant form fields with client data?
you said....
"I'm suppose to get the variables in form field like:

PHP Syntax (Toggle Plain Text)

<input name="firstname" id="firstname" size="20" maxlength="255" disabled="true">

"
is the return client data supposed to be a new form, or are you wanting to populate your 'clientForm' form on client_retrieval_Mossa from data retrieved from getclient.php?

Excellent! At the moment, I simply want to display the data. This is currently what I'm able to do with data from a single table. I want to pull other information from different tables and simply display it on the client_retrieval_Mossa form.

I hope this answers your questions.

Mossa--

0

Please trying this, update your code in line 30, 31:

$sql ="SELECT ad.firstname, ad.lastname, ad.address, ad.city, ad.state, ad.zipcode, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, ad.customerid, ad.servicedesc, aj.email, aj.areacode, aj.phoneprefix, ad.clientID,
aj.phonesufix, aj.cellareacode, aj.cellprefix, aj.cellsufix, aj.commentonclient FROM additional_cars as ad JOIN ajax_client as aj ON ad.xxx = aj.xxx WHERE ad.clientID='".$clientId."' group by ad.clientID";

Please change the code in red marked, according to your table structure. what field has relation from ajax_client table to addiotional_cars. Example, id_client.
So the code look like:

$sql ="SELECT ad.firstname, ad.lastname, ad.address, ad.city, ad.state, ad.zipcode, ad.dhtmlgoodies_category, ad.dhtmlgoodies_subcategory, ad.caryear, ad.customerid, ad.servicedesc, aj.email, aj.areacode, aj.phoneprefix, ad.clientID,
aj.phonesufix, aj.cellareacode, aj.cellprefix, aj.cellsufix, aj.commentonclient FROM additional_cars as ad JOIN ajax_client as aj ON ad.clientID = aj.clientID WHERE ad.clientID='".$clientId."' group by ad.clientID";

Good luck

0

I found this to work for me so far. I'm not sure exactly how you want to handle the data coming back from getclient.php so I am posting 2 solutions on how you can use the data.

<script type="text/javascript">
    var currentClientID = false;
    function getClientData() {
		alert('get client data  called!');
		var clientId = $('#clientID').val().replace(/[^0-9|a-z|A-Z]/g,'');//here to incorporate the client id with numbers and letters
		alert('get client data for ' + clientId + ' called!');
		if(clientId.length >0 && clientId!=currentClientID){//here to change the client id length	
			//alert("do get ");
			/*  original code...
			$.ajax({
				url: 'getclient.php?getClientId=' + clientId,
				type: "GET",
				success: function showClientData(response) {
					var formObj = document.forms["clientForm"];
					eval(response);
					currentClientID = clientId;
				}
			});
			*/
			// You can take out the alert(msg) call from this part...
			bodyContent = $.ajax({
				  url: "getclient.php",
				  global: false,
				  type: "POST",
				  //data: ({clientID : this.getAttribute('id')}),
				  data: ({clientID : clientId}),
				  dataType: "html",
				  async:false,
				  success: function(msg){
					 alert(msg);
				  }
			   }
			).responseText;		
			//document.getElementById("form_div").innerHTML=bodyContent;
			/********************************
			// this is where you have options and can decide exactly what output your getclient.php needs to return.
			// you could wrap it all up in preformatted html and then display stuff on the page by 
			// appending a div   ---- (i've named 'form_div' on the page...)
			// or in this case, I have added back in the eval() statement to populate existing form
			// fields on clientForm below.
			******** if you are returning javascript use eval, and you can comment out the add_div stuff below.
			******** if you are returning plaintext / table structure value use add_div function below and remove eval code.
			******** you can decide best how you want to handle the data.
			**********************************/
			var add_div = jQuery(document.createElement('div')).attr('id',clientId).text(bodyContent);	
			//alert("add to div = ");
			add_div.appendTo("#form_div"); 			
			//alert("call eval");
			eval(bodyContent);
			//alert('done eval');
		
		}
		alert('end content function');
    }
</script>




<form name="clientForm" id="clientForm" action="#" method="post" onsubmit="javascript:getClientData(); return false;"><!--ajax-client_lookup.html-->
<input type="text" name="clientID" id="clientID" value=""><br>
<table>
<td><label for="firstname">First name:</label></td>
<td><input name="firstname" id="firstname" size="20" maxlength="255" disabled="true"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><label for="lastname">Last name:</label></td>
<td>
<input name="lastname" id="lastname" size="20" maxlength="255" disabled="true"></td>
<input type="hidden" name="displayname" id="displayname" size="20" maxlength="255">
<input type="hidden" name="lastname1" id="lastname1" size="20" maxlength="255"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><label for="address">Address:</label></td>
<td><input name="address" id="address" size="20" maxlength="255" disabled="true"></td>
<td>&nbsp;</td>
</tr>
</table>
<input type="submit" name="submit" value="Submit">
</form>

<!--  this is where your returned data will display if you use the 'add_div' code from above.   -->
<div id="form_div"></div>

I had a strange occurrence when testing, once the response was complete, the page would reload because of the form onsubmit functionality. to work around this I added return false; to the call:

<form name="clientForm" id="clientForm" action="#" method="post" onsubmit="javascript:getClientData(); return false;">

getclient.php

<?php
/***********************
case 1, fill in current form data on client_retrieval page...
use the eval()
************************/
include_once('client.class.php');
$id = $_POST['clientID'];
//echo "id = " . $id . "<BR>";
$c = new client();
$client = $c->select_by_id($id);
//$client->print_to_screen();
// right now, I am returning javascript but not in js tags or anything.  you are 'already' in javascript when calling and retrieving data
// so you just have to have a 'plain text' javascript reference like below.  This return statement will fill in the firstname, lastname and address 
// on your clientForm.
// the following will be returned as 'html' or a plain text string.
?>
document.clientForm.firstname.value = "<?php echo $client->get_firstname(); ?>";
document.clientForm.lastname.value = "<?php echo $client->get_lastname(); ?>";
document.clientForm.address.value = "<?php echo $client->get_address(); ?>";
<?php 
// exit page to return response.
exit;
?>

one last note:

An alternative to setting js variables, you could build like an html table or something else to be returned to the page.
If that is the case do not use eval().  eval() is to evaluate javascript logic so if you have a table or other data that you want
return something like:
<?php
/***********************
case 2, return formatted html
************************/

include_once('client.class.php');
$id = $_POST['clientID'];
//echo "id = " . $id . "<BR>";
$c = new client();
$client = $c->select_by_id($id);
?>
<table>
<tr><td>firstname</td><td>lastname</td><td>address</td></tr>
<tr><td><?php echo $client->get_firstname(); ?></td><td><?php echo $client->get_lastname(); ?></td><td><?php echo $client->get_address(); ?></td></tr>
</table>
<?php 
// exit page to return response.
exit;
?>
And then use the append_div() call as opposed to eval()
0

I left an extra alert() or two in the code I tried to comment most of them out. Let me know what you think Mossa. It is functional and tested.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.