For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > November 2004 > RE: [PHP-DB] Forms list from database









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [PHP-DB] Forms list from database
Martin Norland

2004-11-01, 8:55 pm

Assuming, for the moment, that there's more code above that to actually sup=
port this...

You want to be quoting the keys in the array, and containing each array 'lo=
okup' in {}s:
print " $check[LNAME],$check[FNAME]($check[CID])
";
Should be
print " {$check['LNAME']},{$check['FNAME']}({$ch
eck['CID']})";

However - in the future, try to include all relevant code. The surrounding=
table code isn't important, but the code you're using for your query and t=
o connect to the database/etc. is.

- Martin Norland, Database / Web Developer, International Outreach x3257
The opinion(s) contained within this email do not necessarily represent tho=
se of St. Jude Children's Research Hospital.


-----Original Message-----
From: Jason T. Davidson [mailto:davidson@aero.und.edu]=20
Sent: Monday, November 01, 2004 3:11 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Forms list from database


Here is the code:

<form name=3D"form1" method=3D"post" action=3D"staff_code/add_code.php"> <t=
able width=3D"600" border=3D"0" align=3D"center" cellpadding=3D"0"=20
cellspacing=3D"0">
<tr bgcolor=3D"#CCCCCC">
<td colspan=3D"3" bgcolor=3D"#FFFFFF"><div align=3D"center">
<select name=3D"controller" id=3D"controller">
<option> </option>
<option>
<?
while ($check=3Dmysql_fetch_array($result)){
print " $check[LNAME],$check[FNAME]($check[CID])
";
}
?>
</option>
</select>
</div></td>
</tr>


--
Jason Davidson

Juan Stiller wrote:
> It might be usefull to see the code you are using to
> show the query results.
>=20
> --- "Jason T. Davidson" <davidson@aero.und.edu>
> escribi=F3:
>=20
>=20
>=20
>=20
> =09
>=20
> =09
> =09
> ___________________________________
> =A1Llevate a Yahoo! en tu Unif=F3n!=20
> Ahora pod=E9s usar Yahoo! Messenger en tu Unif=F3n, en cualquier momento =

y lugar.=20
> Encontr=E1 m=E1s informaci=F3n en: http://ar.mobile.yahoo.com/sms.html


--=20
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com