Posted by Ivαn Sαnchez Ortega on 03/20/06 22:17
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
brad wrote:
> I'm sorry. I didn't notice that it wase an Access database, which is
> not what I am going to use. I will be using a MySQL database. Sorry
> about that. With that in mind, MySQL, how would I code the second part
> in PHP..of creating the table. This part:
> response.write("<table>")
> do until rs.EOF
> for each x in rs.Fields
> response.write("<tr><td><b>" & x.name & "</b></td>")
> response.write("<td> & x.value & "</td></tr>")
> next
> rs.MoveNext
> loop
>
> response.write("</table>")
$rs = mysql_query($sql,MYSQL_ASSOC);
echo '<table>';
while ($row = mysql_fetch_array($rs))
{
foreach($row as $column_name=>$value)
echo "<tr><td><b>$column_name</b></td><td>$value</td></tr>";
}
echo '</table>';
- --
- ----------------------------------
IvΓ‘n SΓ‘nchez Ortega -i-punto-sanchez--arroba-mirame-punto-net
http://acm.asoc.fi.upm.es/~mr/ ; http://acm.asoc.fi.upm.es/~ivan/
MSN:i_eat_s_p_a_m_for_breakfast@hotmail.com
Jabber:ivansanchez@jabber.org ; ivansanchez@kdetalk.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
iD8DBQFEHw303jcQ2mg3Pc8RAuiQAJ93yo7YE1V2o9LMpS+So4tZNWnYIwCffABp
R8w3Xz0l6eCVp4f0zy9nZnI=
=Gtre
-----END PGP SIGNATURE-----
[Back to original message]
|