Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LIMIT not working correctly?

Status
Not open for further replies.

CadMonkey

Programmer
Nov 26, 2003
4
GB
I'm running a query such as:

Code:
SELECT * FROM table ORDER BY field ASC LIMIT 0,10
to get the first 10 rows back. I'm gonna keep the 0 in this because it will change later.

It keeps omitting the first row.

I'm sure I've done it right. I've checked the query in phpMyAdmin and it works fine.

Any ideas?

 
1) You have posted in the wrong forum. This one deals is SQL server.

2) If it works in phpMyAdmin, the error is propably in your code that retrieves and displays the data.

e.g. doing something like

Code:
$c = mysql_query($sql);
$r = mysql_fetch_array($c);
if ( $r ) {
  while ( $r = mysql_fetch_array($c) ) {
// display data
  }
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top