Weird problem with SELECT command..Help!

Posted on 16th Feb 2014 by admin

Hi!

It seems I'm having a really weird problem with SQL SELECT command....I have table into a mySQL DB wich as 4 entry in it. I created the select command to retrieve the data and only 3 of the 4 entry is displaying. If I enter a 5th entry. Only 4 of the 5 will display....?

Here's the code :

<?php

mysql_connect("server", "user", "pass") or die(mysql_error());
mysql_select_db("db") or die(mysql_error());

$data = mysql_query("SELECT * FROM artists")
or die(mysql_error());

$info = mysql_fetch_array( $data );

while($info = mysql_fetch_array( $data ))
{
echo "
<center>
<table border="1" cellpadding="0" cellspacing="0" width="400">
<tr>
<td width="150"><img src="admin/artists photo/".$info['photo']."" /></td>
<td width="250"><h1>".$info['artist']."</h1></td>
</tr>
</table><br />
</center>

";
}
?>

If anyone sees what I did wrong it would be really appreciated!

Thanks

Other forums