i am going to divide a sql query result into two parts. the reason why i want to do this is that i just want my server handle first only 20 items and then after sleep the rest part.
how is it possible in sql to part the query into multiple queries after mysql_query so that i can process the parts separately one after another?
my vision is this:
if(mysql_row_nums($sql)>20){
handle only 20 items
} else {
handle all
}
thanks for reading.
you can do this by setting
limit 0,20in queryLimit is used to limit your MySQL query results to those that fall within a specified range. You can use it to show the first X number of results, or to show a range from X – Y results.