<?php
//set up database connection
$DSN = mysql_connect("localhost", "username", "password") or die("Cannot
connect to database!");
mysql_select_db("DBname", $DSN) or die("Cannot select the database!");
//run query
$result = mysql_query ("SELECT * FROM tblTable") or die ("Invalid query");
?>
<table border="1" width="100%" cellpadding="3" cellspacing="0">
<?php
while($rowarray= mysql_fetch_array($result)) {
?>
<tr>
<?php foreach($rowarray as $column) { ?>
<td>
<?php print nl2br(htmlentities($column)); ?></td>
<?php } ?>
</tr>
<?php
}
mysql_close($DSN);
?>
</table>
How'd I do?
David Huyck
[EMAIL PROTECTED]
| I would be very interested in seeing the exact differences between the two.
| And if the PHP guys start flaming, just ask them how long it takes them to
| code a database query and output the results in a table.
|
| Their answer would probably be:
|
| <? #$ t00 $value %l0ng ?> he he
|
| Russ Johnson
| Web Environment Services
| Blue Cross Blue Shield of Florida
| Work: 904-905-7130
| Mobile: 904-534-8162
| [EMAIL PROTECTED]
|
| "Open source software - with no walls and fences, who needs windows and
| Gates?"-- Anonymous
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists