Forum Moderators: coopster

Message Too Old, No Replies

100 rows at a time, query

         

askeli

2:11 am on Mar 13, 2007 (gmt 0)

10+ Year Member



Can someone point me in the right direction,

Im running a multithreading curl script that proccess' 1000 urls, i need to select the urls from db 100 at a time, so limit 0,100 then when curl's finished limit 100,100 and so on, any ideas how to do this loop, its not pages and runs background.

thanks

xoe26

7:38 am on Mar 13, 2007 (gmt 0)

10+ Year Member



Do you mean something like this?

$i = 0;
$ii = 100;

While ($ii < 1000) {

$query = "SELECT url FROM database LIMIT $i, $ii";

$i = $i+100;
$ii = $ii+100;

}

askeli

11:50 pm on Mar 13, 2007 (gmt 0)

10+ Year Member



i needed it to still work if the total was over 1000, got a count from the table and your idea works just fine.

Many Thanks