Hi Marcus,
I have the ibm_db2 driver configured. I made the changes to php.ini file as
extension=pdo.so
extension=ibm_db2.so
ibm_db2.instance_name=knellim
I have written php file in /var/www/html as
- <?php
-
// Create the uncataloged connection string
-
$DSN = "DRIVER={IBM DB2 ODBC DRIVER};PROTOCOL=TCPIP;"
-
. "DATABASE='TEST';HOSTNAME='localhost';PORT=1527;"
-
. "UID='knellim';PWD='db2';";
-
$conn = db2_connect($DSN,null,null);
-
$sql = "SELECT id FROM resource";
-
$stmt = db2_prepare($conn, $sql);
-
$res = db2_execute($stmt, array(10));
-
while ($row = db2_fetch_assoc($res)) {
-
print "{$row['id']}\n";
-
}
-
?>
and when i run it I as php connect.php , I get
PHP Warning: db2_prepare() expects parameter 1 to be resource, boolean given in /var/www/html/testvcl.php on line 9
PHP Warning: db2_execute() expects parameter 1 to be resource, null given in /var/www/html/testvcl.php on line 10
PHP Warning: db2_fetch_assoc() expects parameter 1 to be resource, null given in /var/www/html/testvcl.php on line 11
Pls can u help me with this.. Any idea why this is happening..??