How do I limit the number of rows returned?
Most often this is to reduce the amount of material returned, speed things up and make it useable via the web.
Often with paginated queries - e.g. 50, next 50, back 50 and so on this is also a technique you will see used.
It's easily done using the LIMIT structure with mysql which are then past an optional minimum and necessary max number of rows to return.
Thus to return 50 rows, do this:
$q = mysql_query("SELECT * FROM table LIMIT 50");
If you want to return 20 rows starting at row 10, include the min part like so:
$q = mysql_query("SELECT * FROM table LIMIT 10,20);
More mysql PHP Questionshow do i upload an image to database?
How do I return the date with mySQL?
Why does this code not work? Returns this error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND ClaimNo = AND UserName = john' at line 2
First of all I'm new to php n' mySql . So I just can't figure out what's the wrong in my code. I'm using WAMP and I've created a db named "Try" and in that there is a table named "test". this is my php code and it dosen't give me a
how will use a mysql_query to get a single4 person list? With example.