Erica McLane Posted May 27, 2003 Share Posted May 27, 2003 How to do this? I have a table, simmilar to this: Tablename Test. ID | Title | Text 1 | One | Test1 2 | Two | Test2 3 | Three | Test3 4 | Four | Test4 5 | Five | Test5 I filled one drop-down listbox with the values in Title. Now I need this - the script should display the \'Text\' value, depending on the selected \'Title\' in the SAME PAGE, when the user selects the \'Title\" in the listbox. Is there a way to do this? Thanks in advance! Example: There is a listbox and the user selects \'Two\'. Now the script should display \"Test2\". Link to comment https://forums.phpfreaks.com/topic/517-selecting-mysql-variable-value-that-depends-to-other-value/ Share on other sites More sharing options...
wompus Posted May 27, 2003 Share Posted May 27, 2003 This would be your drop-down <input name="something"> This would be your php [php:1:9d98bc23a5]$query = \"SELECT * FROM tablename WHERE Title = $something\"; $result = mysql_query($query); while($row = mysql_fetch_array($result)){echo($row[\'Text\']);}?>[/php:1:9d98bc23a5][/code] Link to comment https://forums.phpfreaks.com/topic/517-selecting-mysql-variable-value-that-depends-to-other-value/#findComment-1732 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.