Answers

Question and Answer:

  Home  Progress

⟩ Tell me what are the steps and needed resources for connecting to a Progress Database?

// DATABASE CONNECTION AND SELECTION VARIABLES - GET THESE FROM YOUR HOSTING COMPANY

$db_host = "localhost"; // PROBABLY THIS IS OK

$db_name = "??";

$db_user = "??";

$db_word = "??";

// WARNING: AN UNCAUGHT CONNECT ERROR WILL BARK OUT THE DB CREDENTIALS!

// $pdo = new PDO("mysql:host=$db_host;dbname=$db_name", $db_user, 'foo');

// OPEN A CONNECTION TO THE DATA BASE SERVER AND SELECT THE DB

$dsn = "mysql:host=$db_host;dbname=$db_name";

try

{

$pdo = new PDO($dsn, $db_user, $db_word);

}

catch(PDOException $exc)

{

var_dump($exc);

trigger_error($exc->getMessage(), E_USER_ERROR);

}

// SHOW THE PDO CONNECTION OBJECT

var_dump($pdo);

echo PHP_EOL;

 161 views

More Questions for you: