I have the following vehicle table:
- Code: Select all
- CREATE TABLE IF NOT EXISTS ` t_vehicles ` (
 `ID` int(11) unsigned NOT NULL auto_increment,
 `NAME` varchar(32) NOT NULL,
 `DESCRIPTION` text,
 `CLASS_ID` int(11) unsigned default NULL,
 `IS_OK` tinyint(1) NOT NULL default '0',
 PRIMARY KEY (`ID`),
 UNIQUE KEY `UNIQUENAME` (`CLASS_ID`,` NAME`),
 KEY ` CLASS_ID` (`CLASS_ID`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
I need to know the available vehicle by class. I add this code in \tables\t_class\relationships.ini file :
- Code: Select all
- [vehicle_ok]
 action:label = " Available Vehicles "
 __sql__ = "SELECT * FROM t_vehicles WHERE IS_OK='1' AND CLASS_ID='$ID'"
 action:order = 3
 section:visible = 1
I have the folloving error:
Fatal error: Cannot use object of type PEAR_Error as array in C:\xampp\htdocs\externalDB\eUCAD\xataface\Dataface\Record.php on line 1521
If I modify this in \tables\t_class\relationships.ini file:
- Code: Select all
- [vehicle_ok]
 action:label = " Available Vehicles "
 __sql__ = "SELECT * FROM t_vehicles WHERE CLASS_ID='$ID'"
 action:order = 3
 section:visible = 1
There is no error, but I can see all the vehicles of the class. I need to filter the available. Do you have an idea ?
Thanks in advance,
Patrice.
 
		