First we need to open a connection to a database by providing the FairCom Database Engine with a user name, password and the database name.
Below is the code for Initialize():
//
// Initialize()
//
// Perform the minimum requirement of logging onto the c-tree Server
//
function Initialize() {
echo "<h4>INIT</h4>\n";
// connect to server
try {
$ses = new PDO('ctsql:port=6597;host=localhost;dbname=ctreeSQL', 'admin', 'ADMIN');
}
catch( PDOException $Exception ) {
print($Exception->getMessage() . " - SQL ERROR [" . $Exception->getCode() . "]<br>\n");
print("*** Execution aborted *** <br>\n");
exit();
}
return ($ses);
}