RE: [PHP-DB] Drop down list
| From: | Rick Emery | Date: | Wed, 30 Jan 2002 15:05:41 +0000 |
| Subject: | RE: [PHP-DB] Drop down list | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-16312@lists.php.net to get a copy of this message | ||
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:dlugolin@decef.elf.stuba.sk]
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:webmaster@musicsearch.ath.cx]
> > 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: php-db-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-db-help@lists.php.net
> > To contact the list administrators, e-mail:
> > php-list-admin@lists.php.net
> >
> >
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net