i tried so many code, but the result still a blank page. i have mysql database stored in my localhost, and i did not use phpmyadmin to create the table.
Did i have to create mysql table via phpmyadmin,so that php can access it? i also use MAMP for apache web server and mySql server running.
<!DOCTYPE HTML>
<?php
//make connection
mysql_connect('localhost', 'root', '');
//select database 
mysql_select_db('locker');
$sql= "SELECT * FROM locker";
$records=mysql_query($sql);
echo #records;
?>
<HTML>
<body>
<table width="600" border="1" cellpadding="1" cellspacing="1">
<tr>
 <th>username</th>
 <th>UID</th>
 <th>NoLoker</th>    
    </tr>
<?php
while ($locker=mysql_fetch_assoc($records))
{
    echo "<tr>";
    echo "<td>".$locker['username']."</td>";
    echo "<td>".$locker['UID']."</td>";
    echo "<td>".$locker['NoLoker']."</td>";;
    echo "</tr>";
}//end while
?>
</table>
</body>
