LinnCounty
Programmer
I have a PHP script that connects to our IBM DB2 Server (as400).
When I run
$query = "SELECT COUNT(row) FROM table";
$execute = odbc_exec($conn,$query);
$result = odbc_fetch_array($execute);
I get a response of 6611.
but when I run
$query = "SELECT row FROM table";
$execute = odbc_exec($con,$query);
while(odbc_fetch_array($execute)) {
$count ++;
}
I only get 3406.
What gives???? It seems if the count() is lower then the $count is closer but never the same..
please help!!
I've done a
while ($r < $row) {
odbc_fetch_into($data,$execute,$r);
$r++;
}
And this works, but is VERY VERY VERY SLOW, and times out if more than a few thousand results.
When I run
$query = "SELECT COUNT(row) FROM table";
$execute = odbc_exec($conn,$query);
$result = odbc_fetch_array($execute);
I get a response of 6611.
but when I run
$query = "SELECT row FROM table";
$execute = odbc_exec($con,$query);
while(odbc_fetch_array($execute)) {
$count ++;
}
I only get 3406.
What gives???? It seems if the count() is lower then the $count is closer but never the same..
please help!!
I've done a
while ($r < $row) {
odbc_fetch_into($data,$execute,$r);
$r++;
}
And this works, but is VERY VERY VERY SLOW, and times out if more than a few thousand results.