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

controlling/creating accounts with privileges
hi all,
i'm trying to figure out how i can create/control account with privileges, for instance a

Help with form post data and arrays
Hi all,

I am new to this forum... It has been awhile since i have worked with arrays, and i a

Multiple websites question.
Hi, does php have any functionality that enables a programmer to extract information from a website

Why do I get this error?
Error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or

order by date not ID number help php
I am trying to orginize the following code to order by date not id number.
any help would be grea

Sufficient protection from bad input?
I am writing a simple script to let people upload 'pages' of their own content, be it simply a few b

how to query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass

quick question
Hi ..

i have a question
how do i set a var so it displays via an echo
Code: $logo = '&a

Date Question
I'm using the TIMESTAMP() function within mysql to set the date/time for certain events. However, ho

Progress bar for webpage
Hi,
I want to implement a progress/waiting bar on my webpage - exactly the same thing that the Mi

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