Greetings.
I am a PHP newbie trying to setup PHP to access DB2 on an MVS system. PHP is running on Windows 2000 SP3.
The following query returns no results using PHP but returns 1 record (as it should) with other clients (db2cli,perl,brio etc).
$user=""; // removed for security
$upasswd=""; // removed for security
$dsn = "MFG"; // cataloged in DB2 Client
$query = "SELECT * FROM TOOL WHERE TOOLID='337X'";
print "<p>query is: <code>$query</code><br>";
$conn = @odbc_connect($dsn,$user,$upasswd );
if (!$conn) {
print "Connection Failed";
exit;
}
if ($result = odbc_exec($conn, $query)) {
//the following line kills apache...worry about this next
//print "Query returned : " . odbc_num_rows($result) . " rows";
print "Result: '$result'<br>";
odbc_result_all($result, "border = 1");
}
else {
print "Your query produced no results.";
}
The output:
query is: SELECT * FROM MIWVIEW.TOOL WHERE TOOLID='337X'
Result: 'Resource id #2'
No rows found
I think I'm missing something simple. Any suggestions.