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

Access website from only 1 computer...?
One of my customers wants his website to only be accessed by people in which they bought the website

Greek characters in php
Hi,

I'm making a script and I m using for first time greek characters.
I started to write

How to make a input/output field with multiple lines
Hello.
I put a input/output field on the screen but I could not change height of it. I need to

Need help with an email blocker for a guessbook
I am new with php and here is a simple guessbook page but I am being hit with spam from a group of t

Loops and Classes
I am making a template system and everything seems to be going well up until I have to loop in a var

Keeping data in form
How can I keep whatever I write in the form?

Pulling out some result data from MYSQL
Hey Guys,

I've built a PHP page that has a for just imagine something like registration form

Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing,

Please help with SMTP Authenticated PHP Email Form
Hello, I'm creating a PHP email form, and for this particular server, I have to use SMTP Authenticat

PHP Mysql Staff Induction System
Hi there, I'm pretty new to PHP and Mysql so could really do with being pointed in the right directi

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