Jump to content

[SOLVED] Inserting variables for listbox


jlgray48

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.