View Single Post
Old 08-02-2005, 08:42 PM   #2 (permalink)
Jim_Westergren
Junior Member
 
Join Date: Aug 2005
Posts: 7
Default

Here I give you:

<CENTER>
<H1>MySQL Database</H1>
</CENTER>

<?php

// Database connection
require ("../db.cnf.php");


$sql = mysql_query("SELECT * FROM table ORDER BY column ASC");

echo "<table border='0' CELLPADDING=5 STYLE='font-size:13px'>";
echo "<tr> <td><H3>Column 1 Name</h3></td> <td><H3>Column 2 Name</H3></td> <td><H3>Column 3 Name</H3></td><td><H3>Column 4 Name</H3></td></tr>";
// keeps getting the next row until there are no more to get
while ($row = mysql_fetch_array($sql)) {

// Print out the contents of each row into a table
echo "<tr><td>";
echo $row['Column 1 Name'];
echo "</td><td>";
echo $row['Column 2 Name'];
echo "</td><td>";
echo $row['Column 3 Name'];
echo "</td><td>";
echo $row['Column 4 Name'];
echo "</td></tr>";
}
echo "</table>";

?>

Hope this helped you.
__________________
Jim Westergren
AddURL-Free.com | ArcadeShack.com | JW-Network.com | JW-Webbdesign.se
PM me if you are interested in buying/exchanging text links.
Jim_Westergren is offline   Reply With Quote
Sponsored Links