> -----Original Message-----
> From: Neil Silvester [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 20 September 2001 08:12
> To: [EMAIL PROTECTED]
> Subject: PHP and Mysql problem
> 
> 
> I am having a little problem with a PHP 4 statement in one of my webpages. I 
> am using a drop down box of selections that is built a table in a MySQL 
> database.
> This is what I have so far (everything works well, the correct information 
> is displayed for both the Category and ID column values.
> 
> <select name="Product">
>       <option>Please select a category...</option>
> <?php
> // display entries in the selection box and
> // associate the column ID of each entry
> while ($row = mysql_fetch_array($result)) {
>       echo("<option value=" . $row["ID"] . ">" . $row["Category"] . 

echo("<option value=\"" . $row["ID"] . "\">" . $row["Category"] . 
or
echo("<option value='" . $row["ID"] . "'>" . $row["Category"] . 

I'm not sure if using single quotes is to the HTML specs though.


> "</option>");
> }
> ?>
> </select>
> 
> 
> Unfortunately this causes the HTML code to b
> <OPTION value=1>Product Category 1</OPTION>
> when I need it to be
> <OPTION value="1">Product Category 1</OPTION>
> 
> Can anyone recommend another approach so that the quotation marks are 
> generated around the ID value that is returned?
> TIA
> 


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to