So...I am running PHP 4.0.0 on NT 4 Apache 1.3.9 with SQL Server 7.0
I am trying to pull a recordset from the db and drop it into a table, but there is always one record missing from the results set. Here's the important stuff:
$cur=odbc_exec($cnx, "SELECT * FROM MainTB WHERE MerchantNumber = '$MerchSearch'");
if ( !odbc_fetch_row( $cur ) ) {
echo "<br><br><center>\n<b><i>No records found for $MerchSearch. Please continue.</b></i>\n";
}
else {
echo "<center>\n<br>\n<table cols=5 border=1>\n<tr>\n<th>Log Number</th>\n<th>Merchant Name</th>\n";
echo "<th>Log Date</th>\n<th>Reason</th>\n<th>Total Amount</th></tr>\n";
while( odbc_fetch_row( $cur ) ) {
$LogNum=odbc_result($cur, 1);
$MerchName = odbc_result( $cur, 2 );
$LogDate= odbc_result( $cur, 17);
$Reason= odbc_result( $cur, 11 );
$GrandTotal= odbc_result( $cur, 10 );
$GrandTotal=(number_format($GrandTotal, 2));
echo "<tr>\n<td><a href='/feerev/FRSearchResults.php3?LogNum=$LogNum'>$LogNum</a></td>\n";
echo "<td>$MerchName</td>\n<td>$LogDate</td>\n<td>$Reason</td>\n<td>$GrandTotal</td>\n</tr>\n";
$nbrow++;
}