you can use fetch_array:

$data = mysql_query("select * from Categories");
$aux="<select name=categorie>";
while ($row = mysql_fetch_array($data)) {
  $aux.="<option value=",$row['id'].">".$row['Name']."</option>";
}
$aux.="</select>";

echo $aux;

this code will print in html a combobox with the options, in php, the
variable "$catagorie" will have the "id" number of a categorie...

see you,

Augusto

On Sun, 10 Jun 2001, Vladimir Kravtsov wrote:

> Here is my db hierarchy:
> Database: xtopsites
> Table: Categories
> id    Name
> 1    Name1
> 2    Name2
> 3    Name3
> 4    Name4
> 5    Name5
> 6    Name6
> 
> 
> I would like the user to get to a sign up form and have all the names of the 
>categories displayed.........is this possible to do using fetch_array? If it isn't is 
>there another way? (Also could you provide a valid syntax?)
> 
> 
> 
> Thanks alot :)
> 


---------------------------------------------------------------------
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