$service_blob = json_decode($_ENV['VCAP_SERVICES'], true); $dbname = $service_blob['cleardb'][0]['credentials']['name']; $hostname = $service_blob['cleardb'][0]['credentials']['hostname']; $user = $service_blob['cleardb'][0]['credentials']['username']; $password = $service_blob['cleardb'][0]['credentials']['password']; $port = $service_blob['cleardb'][0]['credentials']['port'];
$connection = mysql_connect($hostname, $user, $password, $dbname,$port); mysql_select_db($dbname);
Thank you for posting your question in this forum to enable others to share their expertise. Clear DB is a third-party service. For broader visibility, consider also posting your question to Stack Overflow with the bluemix tag. The Bluemix Development and Support teams monitor that forum closely.
ClearDB mysqli Problem 0 Answers
Fatal error: Call to undefined function mysqli_init() 1 Answer
Virtual Machine - WWW dont connect any MySQL Host 0 Answers
Wordpress migration to Bluemix - Upload error 2 Answers
Cloning into 'compile-extensions' 0 Answers