Reply to Re: rewritting a short ASP script to PHP

Your name:

Reply:


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]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация