Re: Pregunta y Buenas

From: Date: Sat, 15 Sep 2001 22:36:38 +0000
Subject: Re: Pregunta y Buenas
References: 1  Groups: php.general.es 
Request: Send a blank email to general-es+get-13885@lists.php.net to get a copy of this message
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 El Dom 16 Sep 2001 00:09, escribió: > Ante todo, Muy buenas a todo, les queria consultar si alguno hizo alguna > vez un combo en php, pero que cuando se arme el combo directamente traiga > la info de una base de datos. Desde ya agradeceria la informacion. > > Saludos. Aqui tienes un ejemplo <select name="FAM"> <?php $dbh = mysql_connect("$DBHOST","$USUARIO","$CONTRA"); $result = mysql_db_query("$BASE","select f_cod, f_desc from familias group by p_familia order by f_desc"); while($row = mysql_fetch_array($result)) { $FAMILIA = $row[f_desc]; $ID = $row[f_cod]; $CORT = substr ("$FAMILIA", 0, 16); echo "<OPTION value=\"$ID\">$CORT</option>"; } mysql_close ($dbh); ?> </select> Un saludo - -- Santi Juanico ronin@inicia.es -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjuj1/4ACgkQ+GDzI5NA3LEqXACfVkFCtulBJvKSeX7OS+QV9Khe VKIAoKBPYp2dhCikP7hpwrSHXq2+H/OI =AuuO -----END PGP SIGNATURE-----

« previous php.general.es (#13885) next »