Add an identtiy column to the table, then select all records from the table
where the identity col is between the start and the start+number of rows to
show
Bastien
From: "Rui Cruz" <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Pagination problems
The mssql_fetch_row works with an MS Access database?
Because I'm have the same problem while trying to paginate results. I always
read the whole results into an array an then I break them up using the
array.
This is a stupid and slow solution, but how could one overcome this?
""Pablo M. Riva
first~ may be you can change these:
$ssql = "select * from table ORDER by Name";
$rs = mssql_query($ssql,$conn);
$total_records = mssql_num_rows($rs);
to:
$ssql = "SELECT COUNT(*) AS TOTAL FROM TABLE";
$rs = mssql_squery($ssql,$conn);
$total_records = mssql_result("TOTAL");//may not this function,
Thanks Plabo, it worked perfectly.
And I want to apollogize with all the list for the receipt confirmation,
I completly forgot it.
Thanks again.
Pablo M. Rivas escribió:
upsss.. y forgot $counter++
$counter=0;
while ($row=mssql_fetch_row($rs)) {
if (($counter>=$start) and ($counter<($star
upsss.. y forgot $counter++
$counter=0;
while ($row=mssql_fetch_row($rs)) {
if (($counter>=$start) and ($counter<($start+ $Page_Size)) {
echo "";
//There you go: Show all fields, one to each cell
echo "" . implode("",$row) . "";
echo "\n";
}
$counter++;
}
--
Pablo M. Rivas. h
Hello Jenaro:
First off all (i'ts not exactly your question), but i think you don't
need to make this big array:
$my_array[] ="";
while ($row = mssql_fetch_object($rs)){
$my_array[]="$row->tId";
}
'cause you don't need it... you may directly do something like this:
$counter=0;
while ($row=
Hello everybody,
This is my first message to the list and as usual is to try to solve a
problem.
I am using PHP+IIS+SQLServer on windows platform (no choice at the
moment :(...)
Wel, I am trying to paginate some results this is the code:
$conn = mssql_connect("myserver", "myuser", "mypasswo