christophe Posted November 28, 2006 Share Posted November 28, 2006 Hi there,Right O.K I have this code[code]include_once("includes/config.php");$query="SELECT letter,id,word,description FROM dictionary";$result = mysql_query ($query);echo "<select name=word=''">Word</option>";while($nt=mysql_fetch_array($result)){echo "<option value=$nt[id]>$nt[word]</option>";}echo "</select>";?>[/code]so my question:how do i make this script so when a user selects an option from the drop down box it pulls information from the description field in my database and displays this information on the same page?ive been stuck on this for ages now so any help will be much appreciatedThanksAlex Link to comment https://forums.phpfreaks.com/topic/28723-drop-down-box/ Share on other sites More sharing options...
PHPSpirit Posted November 28, 2006 Share Posted November 28, 2006 [quote author=christophe link=topic=116568.msg475026#msg475026 date=1164713206]Hi there,Right O.K I have this code[code]include_once("includes/config.php");$query="SELECT letter,id,word,description FROM dictionary";$result = mysql_query ($query);echo "<select name=word=''">Word</option>";while($nt=mysql_fetch_array($result)){echo "<option value=$nt[id]>$nt[word]</option>";}echo "</select>";?>[/code]so my question:how do i make this script so when a user selects an option from the drop down box it pulls information from the description field in my database and displays this information on the same page?ive been stuck on this for ages now so any help will be much appreciatedThanksAlex[/quote]You need use AJAX.http://www.w3schools.com/ajax/default.asp Link to comment https://forums.phpfreaks.com/topic/28723-drop-down-box/#findComment-131570 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.