wendyz Posted April 7, 2009 Share Posted April 7, 2009 I wrote a PHP page connected database, there is a select option, I am trying to do is when I select one option, then it will access database and get result to be display on the same page. print "<select style=\"font-family:Geneva, Arial, Helvetica, sans-serif; font-size:16px; font-weight:bold\" name=\"switchid\" id=\"switchid\" onchange=\"Change()\">"; print "<option name=\"ship\" value=\"Select\" selected>Select...</option>"; $sql="select * from xiaoping"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $company=$row['company']; $city=$row['city']; $zip=$row['zip']; $state=$row['state']; $add1=$row['address1']; $add2=$row['address2']; $id=$row['ID'];; print "<option name=\"ship\" value=\"$id\">$company</option>"; } mysql_free_result($result); print "</select>"; above is select code, I can get data from database, then how can I display all result in the same page. And every time I change option, the different result will be displayed. Link to comment https://forums.phpfreaks.com/topic/153060-php-display-result-in-same-page/ Share on other sites More sharing options...
Mchl Posted April 7, 2009 Share Posted April 7, 2009 You need AJAX for that Link to comment https://forums.phpfreaks.com/topic/153060-php-display-result-in-same-page/#findComment-803920 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.