jlgray48 Posted April 24, 2007 Share Posted April 24, 2007 In this code I am trying to insert the variable $i as an option in the listbox. It isn't working yet. Any help would be appreciated. <?php $test = 1; $conn=mysql_connect("127.0.0.1", "odbc", "") ; mysql_select_db("php012",$conn); $sql = "Select * from inventorytable where itemID=$test"; $result = mysql_query($sql,$conn) or die("Error".mysql_error()); while ($array = mysql_fetch_array($result)) { $i=$array["ItemName"] . "<br><br> "; print $i; } print<<<bla <SELECT > <OPTION VALUE="print $i">Option 1 <OPTION VALUE="02">Option 2 <OPTION VALUE="03">Option 3 </SELECT> bla; ?> Link to comment https://forums.phpfreaks.com/topic/48440-solved-inserting-variables-for-listbox/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.