note 92242 rejected from function.odbc-fetch-array by danbrown
| From: | danbrown@php.net | Date: | Wed, 15 Jul 2009 15:19:31 +0000 |
| Subject: | note 92242 rejected from function.odbc-fetch-array by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-158342@lists.php.net to get a copy of this message | ||
Note Submitter: dfordinal at hotmail dot com
----
I have found a problem with my use of odbc_fetch_array. When I use this method with the second
paramater (see odbc_fetch_array($resultset, $rowNum) below). I get data corruption after the 32,767
row. We have one table with 95,000 rows and this was a test. The record in this row replaces every
other row of those remaining in the result set. So if the data in that row has the $number 32767,
$name Ohio State, etc then that record will overwrite the 32769, 32771 records and every other one
after that. Take the following code:
$rowNum = $rowsToFetch - $rowsPerPage + 1;
while ($row = odbc_fetch_array($resultset, $rowNum)){
displayRowAssoc($row);
$rowNum++;
}
$number = $row['NUM'];
$name = $row['NAME'];
$address = $row['ADDRESS'];
$type = $row['TYPE'];
$ctrl = $row['CTRL'];
$chgdate = $row['MODDTE'];
$cash = $row['CASHCODE'];
<td>$number</td>
<td>$name</td>
<td>$address</td>
<td>$type</td>
<td>$ctrl</td>
<td>$chgdate</td>
<td>$cash</td>
Does anyone have any ideas of how to get around this?