Hello,
Basically, i have a PHP difficulty. What i am trying to do is individually select the fields in which are required using a while loop. This works brilliantly. Each field has its own unique ID.
What i'm wanting to do is display the results in a drop down selection, and echo the id into the value of the option value so therefore the outcome of choosing one of the items listed, when it comes to it will be easily found with its id. But this method will not work. Please see below.
<?
$ferretchi = mysql_query("SELECT * FROM ferrets WHERE ownerid = '$_SESSION[id]' ORDER BY ferretid DESC");
while ($che = mysql_fetch_array($ferretchi))
{ ?>
<option value="<? echo $che['ferretid']; ?>"><? echo $che['ferretname']; ?></option>
<? } ?>
Please can somebody tell me why Echoing the ID for the field will not work. Or an alternative solution. Cheers!
Basically, i have a PHP difficulty. What i am trying to do is individually select the fields in which are required using a while loop. This works brilliantly. Each field has its own unique ID.
What i'm wanting to do is display the results in a drop down selection, and echo the id into the value of the option value so therefore the outcome of choosing one of the items listed, when it comes to it will be easily found with its id. But this method will not work. Please see below.
<?
$ferretchi = mysql_query("SELECT * FROM ferrets WHERE ownerid = '$_SESSION[id]' ORDER BY ferretid DESC");
while ($che = mysql_fetch_array($ferretchi))
{ ?>
<option value="<? echo $che['ferretid']; ?>"><? echo $che['ferretname']; ?></option>
<? } ?>
Please can somebody tell me why Echoing the ID for the field will not work. Or an alternative solution. Cheers!