Open GoogleCodeExporter opened 9 years ago
i have made a new php script to resolve this kind of exception , this script
should be included or required even once a time for every database request /
response to perform , here is the code / example :
/* Helpers and Entities to Include */
include('common.inc.php');
/* Entities to Include */
include_once 'classes/Employees.class.php';
/* Connection */
$db=new PDO('mysql:dbname=pfe;host=localhost', 'root', 'mrad');
// query all members (query by example currently only available for PDO!)
$example= new Employees();
foreach (Employees::findByExample($db, $example) as $e) {
echo $e->getLastName() . ':' . $e->getFirstName() . "\n";
}
where the common.inc.php is looking like that :
/*
* Common Inclusion Script
*/
include 'helpers/DFCInterface.class.php';
include 'helpers/DFC.class.php';
include 'helpers/DFCAggregate.class.php';
include 'helpers/DSC.class.php';
include 'helpers/SimpleDatabaseInterface.class.php';
include 'helpers/Db2PhpEntity.class.php';
include 'helpers/Db2PhpEntityBase.class.php';
include 'helpers/Db2PhpEntityModificationTracking.class.php';
the script should be saved in the site root directory and helpers directory is
the directory containing the helpers class files needed for db2php library to
work properly and classes directory is the directory of generated entities /
models from mysql database tables ...
Hope it helps
Original comment by mrad1...@gmail.com
on 3 May 2013 at 11:07
Original issue reported on code.google.com by
mrad1...@gmail.com
on 2 May 2013 at 12:11