Retrieve by sets

hi. i am creating a control panel where it gets conversations from mySQL database. the problem is that flash gets the whole data from database and its taking a long time to download them. what i did is count all datas and place set on the bottom of the page where you can select what set you would like to view. my problem is i dont know how to spin my php where it will only get the set that is requested.

e.g.
sets [color=red]1[/color] | 2 | 3 | 4

if 1 is selected will show records 1 to 10

if 2 is 11 - 20 etc.

anyway, here is a part of the script that works loading everything to flash:

$qr = [color=blue]mysql_query[/color][color=red]("SELECT * FROM records WHERE clientID = ‘$thisClient’ ORDER BY $sortBy $order ")[/color];

$nrows = [color=blue]mysql_num_rows/color;
$rString = [color=red]“n=”[/color].$nrows;
for ($i=[color=red]0[/color]; $i < $nrows; $i++) {
$row = [color=blue]mysql_fetch_array/color;
$rString .= [color=red]"&idno"[/color].$i.[color=red]"="[/color].$row[[color=red]‘idno’[/color]].[color=red]"&visitor"[/color].$i.[color=red]"="[/color].$row[[color=red]‘visitor’[/color]];
$rString .= [color=red]"&stamp"[/color].$i.[color=red]"="[/color].$row[[color=red]‘stamp’[/color]].[color=red]"&record"[/color].$i.[color=red]"="[/color].$row[[color=red]‘record’[/color]].[color=red]"&status"[/color].$i.[color=red]"="[/color].$row[[color=red]‘status’[/color]];
}
[color=blue]echo[/color] $rString;
$query = [color=blue]mysql_query[/color]([color=red]"[/color][color=red]SELECT * FROM records WHERE clientID = ‘$thisClient’ “[/color]);
$numRows = [color=blue]mysql_num_rows/color;
[color=blue]echo[/color] [color=red]”&hehe=$numRows"[/color];
?>