Why is this PHP code wrong in the browser? I don't think there's anything wrong. Error:
This is the <body>
code:
<body>
<center>
<div class="header">
MySQL Results
</div>
</center>
<?php
include_once 'db_functions.php';
$db = new DB_Functions();
$users = $db->getAllUsers();
if ($users != false)
$no_of_users = mysql_num_rows($users);
else
$no_of_users = 0;
?>
<?php
if ($no_of_users > 0) {
?>
<table>
<tr id="header"><td>Id</td><td>Username</td></tr>
<?php
while ($row = mysql_fetch_array($users)) {
?>
<tr>
<td><span><?php echo $row["Id"] ?></span></td>
<td><span><?php echo $row["Name"] ?></span></td>
</tr>
<?php } ?>
</table>
<?php }else{ ?>
<div id="norecord">
No records in MySQL DB
</div>
<?php } ?>
<div class="refresh">
<button onclick="refreshPage()">Refresh</button>
</div>
</body>