First conect to DB
$result=mysql($DBname,"SELECT * FROM table";

print "<SELECT name = artist>";
while( list($artist_id,$name) = mysql_fetch_array($result) )
{
        print "<OPTION value=\"$artist_id\">$name</OPTION>\n";
}
print "</SELECT>";

-----Original Message-----
From: Julius Dlugolinsky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 30, 2002 8:48 AM
Cc: Php-DB
Subject: RE: [PHP-DB] Drop down list




First conect to DB
$result=mysql($DBname,"SELECT * FROM table where 1");
$no=mysql_numrows($result);
$i=0;
$string="";
while ($i<$no){
$string.="<option
value=\"".mysql($result,$i,"$artist_id")."\">".mysql_result($result,$i,"arti
st")."</option>";
$i++;}
$string="<select name=artist>$string</select>";
and in string is drop down menu.
        
EXO (www.exo.sk)
 


> > -----Original Message-----
> > From: B.J.Rumsey [mailto:[EMAIL PROTECTED]]
> > Sent: 30. tammikuuta 2002 10:18
> > To: php-db
> > Subject: [PHP-DB] Drop down list
> >
> >
> >   I have two fields artist_id, artist. How do I put the contents of 
> > "artist" into a dropdown list.
> >
> >
> > ____________________________________________________
> >   IncrediMail - Email has finally evolved - Click Here
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: 
> > [EMAIL PROTECTED]
> >
> >
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to