It appears I have found a
problem with ODBC and Pervasive.
With the following php code (searching for G94):
$connect =
odbc_connect("pfwOPE", "", "");
$query = "SELECT * FROM INLOC WHERE Itemkey LIKE 'G94' AND Locationkey
LIKE 'VB'";
$result = odbc_exec($connect, $query);
echo odbc_field_name($result, 1).": ".odbc_result($result, 1); //
First field is ItemKey
odbc_close($connect);
Result:
Itemkey:
G94
With the following code (searching for DAYBREAK):
$connect =
odbc_connect("pfwOPE", "", "");
$query = "SELECT * FROM INLOC WHERE Itemkey LIKE 'DAYBREAK' AND
Locationkey LIKE 'VB'";
$result = odbc_exec($connect, $query);
echo odbc_field_name($result, 1).": ".odbc_result($result, 1); //
First field is ItemKey
odbc_close($connect);
Result:
Itemkey:
In fact I can use SELECT * FROM INLOC WHERE Itemkey
LIKE 'D%'
And I still get nothing
even though there are several itemkeys that begin with “D”.
Executing the same queries in the PCC produces the correct results.
An
alternate version of the problem...
Doing:
$query =
"SELECT * from INLOC";
$result = odbc_exec($connect, $query);
while( odbc_fetch_row($result) ){
... display the records
}
Only produces the first
two of the 220 or so records so odbc_fetch_row is returning false even though
there are more rows.
If I do this:
$query =
"SELECT * from INLOC";
$result = odbc_exec($connect, $query);
$query = "select count(*) as cnt from INLOC";
$count = odbc_exec($connect, $query);
$rowcount = odbc_result($count, 1);
$zz = 0;
while( $zz < $rowcount ){
$zz++;
... Display the records
}
Then I get all 220
INCLUDING DAYBREAK!