i have reveiewed the issues found to fix some errors of db2php but i finally
got this exception :
Fatal error: Uncaught exception 'Exception' with message '00000:array ( 0 =>
'00000', 1 => 1064, 2 => 'You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax to
use near \'"categories"\' at line 1', )' in C:\Program Files\Apache Software
Foundation\Apache HTTP
Server\htdocs\db2php\models\CategoriesModel.class.php:448 Stack trace: #0
C:\Program Files\Apache Software Foundation\Apache HTTP
Server\htdocs\db2php\models\CategoriesModel.class.php(435):
CategoriesModel::fromStatement(Object(PDOStatement)) #1 C:\Program Files\Apache
Software Foundation\Apache HTTP
Server\htdocs\db2php\models\CategoriesModel.class.php(408):
CategoriesModel::findByFilter(Object(PDO), Array, true, NULL) #2 C:\Program
Files\Apache Software Foundation\Apache HTTP
Server\htdocs\db2php\index.php(27): CategoriesModel::findByExample(Object(PDO),
Object(CategoriesModel)) #3 {main} thrown in C:\Program Files\Apache Software
Foundation\Apache HTTP Server\htdocs\db2php\models\CategoriesModel.class.php on
line 448
to run the following snippet :
<?php
require_once 'helpers/Db2PhpEntity.class.php';
require_once 'helpers/Db2PhpEntityBase.class.php';
require_once 'helpers/Db2PhpEntityModificationTracking.class.php';
require_once 'helpers/DFCAggregate.class.php';
require_once 'helpers/DSC.class.php';
require_once 'helpers/DFC.class.php';
require_once 'helpers/DSC.class.php';
require_once 'models/CategoriesModel.class.php';
$db=new PDO('mysql:dbname=pfe;host=localhost', 'root', 'mrad');
// query all categories with dexterity=12 and reasoning=4 (query by example
currently only available for PDO!)
$categories=new CategoriesModel();
//$example->setDexterity(12)->setReasoning(4);
foreach (CategoriesModel::findByExample($db, $categories) as $catergory) {
echo $catergory->getId() . ':' . $catergory->getLabel() . "\n";
}
?>
can you help me fix it ? i could not be able to show the categories available
in database on page ...
Original issue reported on code.google.com by
mrad1...@gmail.comon 2 May 2013 at 12:11