Weird problem with SELECT command..Help!


Posted on 16th Feb 2014 07:03 pm 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

No comments posted yet

Your Answer:

Login to answer
266 Like 45 Dislike
Previous forums Next forums
Other forums

php file erros / need help please
Hello

Someone decoded a zend file for me.. after uploaded it on ftp i get some errors, i trye

foreach iterator
Hi Guys
Does the foreach loop have an inbuilt iterator ?

Quick variable question
hey guys/gals,
im trying to write a php script and it works fine as i have it, but i need to set

DataTable Help Required
Hi all I am creating an app that utilises and MS Access back end and queries it quite a bit at vario

Getting the full city list from maxminds geoip database
I am suprised I can't find any references to this.

I have maxminds geoip lite installed and i

Get ID from Database when Posting with a HTML Form
I have a form I am submitting to a MySql database. Each product has an ID # attached to it that auto

preg-match with a string and numbers
Hi, I can't get the expression to work for my preg_match, what I'd like is for it to match the strin

Code Review - SQL and Insertion Attacks (Warning: Not for Newbs)
Hey guys,

Its been a while, I know. Use to love coming here to answer peoples questions, but

need to add "sizes" to shopping cart
Hey guys, I am trying to figure out a way to add a "size" selector on to this bit of code.

Conditions of info record - Error
When i created GR (901) and PO create automatic my PBXX is obtain the net price of info record but

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash