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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.