 <p>I think you should put it this way though</p> <pre><code> &lt;?php $connection = mysql_connect('localhost', 'users', 'password'); //The Blank string is the password mysql_select_db('users'); let all the connection be outside the "ul" tag. $query = ("SELECT * FROM oneusers"); //You don't need a ; like you do in SQL $result = mysql_query($query); $query = ("SELECT * FROM oneusers"); //You don't need a ; like you do in SQL $result = mysql_query($query); $row=mysql_fetch_array($result); ?&gt; &lt;ul class="names"&gt; &lt;table&gt; &lt;tr&gt; &lt;th&gt;Navn&lt;/th&gt; &lt;th&gt;Email&lt;/th&gt; &lt;th&gt;Score&lt;/th&gt; &lt;/tr&gt; &lt;?php while($row){ //Creates a loop to loop through results echo "&lt;tr&gt;&lt;td&gt;" . $row['iUserName'] . "&lt;/td&gt;&lt;td&gt;" . $row['iUserEmail'] . "&lt;/td&gt;&lt;td&gt;" . $row['iUserCash'] . " DKK&lt;/td&gt;&lt;/tr&gt;"; //$row['index'] the index here is a field name } mysql_close(); //Make sure to close out the database connection ?&gt; &lt;/table&gt; &lt;/ul&gt; </code></pre>