If information would come from a MySQL Database, how do use AJAX to automatically refresh the information on the PHP page (without refreshing the entire page) as the customer interacts with the current information displayed on the page?
I'm using two optionbox, where by changing the first one, the entry of second would change according to our choice in first one! I want to do this without reloading of entire page...
this link (http://www.w3schools.com/ajax/ajax_database.asp) gives an example, but it uses asp, and I'm using php...
please give me the full answer and full code which I have to use, I'm new in Web designing...
Give me the codes which must be in:
1. php file
2. JS file
3. html
2006-07-18
02:46:46
·
5 answers
·
asked by
QuestionAnswer
2
in
Computers & Internet
➔ Programming & Design
I have to choose a best answer, but non of them is the best!
I got the answer somewhere else, and I'm putting it here:
everything is same as the given link(w3schools.com/...) but instead of asp code, we have to use this php code:
$con = mysql_connect("localhost","Admin","?????????");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test3", $con);
$dd=$_GET['q'];
$ff = "SELECT * FROM CUSTOMERS WHERE CUSTOMERID='".$dd."'";
$result = mysql_query($ff);
if($result)
{
echo "
";
while($row = mysql_fetch_assoc($result))
{
echo "".$row['name']." | ";
echo "".$row['value']." |
";
}
echo "
";
}
?>
2006-07-20
09:26:49 ·
update #1