When i use this this is how it loads : Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /public_html/php/application/views/admin/index.php on line 20 User Name ID
Please Help:
<?php
$con = mysql_connect("hostname","user","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db", $con);
$result = mysql_query("SELECT * FROM users ORDER user_id");
echo "<table border='0'>
<tr>
<th>User Name</th>
<th>ID</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['user_name'] . "</td>";
echo "<td>" . $row['user_id'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
Thanks josh_24_2