0

I am trying to access to dash db from netbenas 8.0 but it is unable to access throwing the error

Call to undefined function db2_connect() in /var/www/PhpProject6/demo3.php on line 11 while running through netbeans8.0

<?php
$database = '';
$user = '';
$password = '';
$hostname = '';
$port = 50000;

$conn_string = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=$database;" .
  "HOSTNAME=$hostname;PORT=$port;PROTOCOL=TCPIP;UID=$user;PWD=$password;";
$conn = db2_connect($conn_string, '', '');

if ($conn) {
    echo "Connection succeeded.";
    db2_close($conn);
}
else {
    echo "Connection failed.";
}
?>
B001ᛦ
  • 2,036
  • 6
  • 23
  • 31

1 Answers1

0

The db2_* functions are in the ibm_db2 extension which you will need to install via pecl so I think first you should check that the extension is installed correctly. You can do this using phpinfo() which gives information about PHP configuration and installed extensions.

Lorna Mitchell
  • 1,819
  • 13
  • 22
  • no there is not ibm_db2 extension so where should i go and enabled db2_connect –  Sep 06 '16 at 10:56