The problem I am having is that when I visit this page (memberlist.php if you were wondering), it is blank, no HTML, nothing.
OK, fair enough, at the moment, there's nothing in the DB, so it shouldn't be displaying rows and rows of information. But, it should still display the titles of the columns (because there's no 'if' or 'where', just 'echo')
PHP Code:
<?php
$con = mysql_connect("localhost", "username", "password"); if (!$con) { die('Could not connect: ' . mysql_error()); }
mysql_select_db("database_name", $con);
$result = mysql_query("SELECT * FROM tablename ORDER BY joined, name");
echo '<table width="100%" border="0"> <tr> <td>#</td> <td>Name</td> <td>Role</td> <td>Joined</td> <td>GB Profile</td> </tr>';
while($row = mysql_fetch_array($result)) { echo "<table> <tr> <td>$row['id']</td> <td>$row['name']</td> <td>$row['role']</td> <td>$row['joined']</td> <td>$row['gb']</td> </tr> </table>"; echo "<br />"; } mysql_close($con);
?>
|