You need to do a while loop to pull each rowset. mysql_fetch_array() will only pull one row at a time. Consider this solution: <?php $dbhost = ‘xxxx’; $dbuser = ‘xxxx’; $dbpass = ‘xxxx’; $dbname = ‘xxxx’; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die (‘Error connecting to mysql’); mysql_select_db($dbname, $conn); $result = mysql_query(“SELECT * FROM mytable”, $conn); <table> […]