Jump to content


Photo

while ($row=mysql_fetch_array($query)){


  • Please log in to reply
3 replies to this topic

#1 joecooper

joecooper
  • Members
  • PipPipPip
  • Advanced Member
  • 358 posts

Posted 26 February 2006 - 01:23 AM

ill try make it simple :).

i have this:

$sql="SELECT * FROM carspage ORDER BY id desc";
$query=mysql_query($sql);
$row=mysql_fetch_array($query);
while ($row=mysql_fetch_array($query)){
// code showing rows from database
}

and it only shows all the rows but not the first one. when i add another entry, it shows all but that one also. and so on...
whats wrong with it?
Signature:
[/a]
[a href="http://www.planet-so...=1999&lngWId=8" target="_blank"]EzLogin 1.0[/a]
[a href="http://www.essexracers.com" target="_blank"]Essexracers.com[/a]
Msn Messenger: joe@joeyjoe.co.uk

#2 wickning1

wickning1
  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 26 February 2006 - 01:27 AM

$row=mysql_fetch_array($query);

Delete that line from above your while loop.

#3 joecooper

joecooper
  • Members
  • PipPipPip
  • Advanced Member
  • 358 posts

Posted 26 February 2006 - 01:30 AM

ooooooohhhhhhhhhhhhhhhhh! dont belive i missed that! :( thanks!
Signature:
[/a]
[a href="http://www.planet-so...=1999&lngWId=8" target="_blank"]EzLogin 1.0[/a]
[a href="http://www.essexracers.com" target="_blank"]Essexracers.com[/a]
Msn Messenger: joe@joeyjoe.co.uk

#4 azfar siddiqui

azfar siddiqui
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 09 March 2008 - 07:11 AM

you have fetched the first row already...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users