Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $vcap_services = $_ENV["VCAP_SERVICES"];
- $services_json = json_decode($vcap_services,true);
- $sqldb = $services_json["sqldb"];
- if (empty($sqldb))
- {
- echo "No sqldb service instance bound. Please bind a sqldb
- service instance before";
- return;
- }
- $sqldb_config = $services_json["sqldb"][0]["credentials"];
- $database = 'SQLDB';
- $user = 'username';
- $password = 'password';
- $hostname = 'host';
- $port = '50000';
- $conn_string = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=$database;" .
- "HOSTNAME=$hostname;PORT=$port;PROTOCOL=TCPIP;UID=$user;PWD=
- $password;";
- echo $conn_string;
- $conn = db2_connect($conn_string, '', '');
- echo "never gets here ";
- if (!$conn)
- {
- print "SQLSTATE value: " . db2_conn_error();
- }
- echo "never gets here either ";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement