Give this a shot...this is just an example...change it to whatever you want/need..
PHP Code:
echo "<table>";
mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to connect to database server!");
mysql_select_db($dbname) or die("Unable to select database!");
$query = "SELECT * FROM table_name ORDER BY id ASC";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_object($result)) {
echo "
<tr>
<td>$row->id</td>
<td>$row->field2</td>
</tr>
";
}
}
else {
echo "<i>No values in the database!</i>";
}
mysql_close($connection);
echo "</table>";
Now that's off the top of my head, using variables and such that I normally use in my code...
I'm new to PHP/MySQL so it's probably not the best code, but hopefully it helps, hehe.
Bookmarks