ODBC fetch row and Progress problems

admin

Administrator
Staff member
Hi there,
We have just installed Merants drivers for Progress and ODBC. We are using PHP4.0.4 on a win nt machine with version 3.51 of ODBC administrator. In our code we are trying to grab more than one row, whatever customer ID is less than 15. What we are receiving on the page is the first record, 15 TIMES. So odbc_fetch_row is not moving the internal pointer to the next row in the fetch. We have seen glimpses of this same problem on the internet where other people had this issue, but no one has an answer. We are assuming it is a driver issue but we don't know if it's MS's ODBC, Merants Progress .dll, or PHP 4. We would appreciate any help! For reference...our code is:

$result = odbc_connect("dsn", "username", "password") or die ("cannot connect");

$sth=odbc_prepare($result,"SELECT CustNum, Name FROM PUB.customer WHERE customer.CustNum < '15'") or die("cannot do");
if(odbc_execute($sth))
{
while (odbc_fetch_row($sth)) {
echo odbc_result($sth, 1);
echo "&nbsp;&nbsp;&nbsp;";
echo odbc_result($sth, 2);
echo "<br>\n";
}
}
else{
echo"execute failed.";

And our output is:
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours
1 Lift Tours

Thanks in advance for any help!
 
Back
Top