Filter in relationships.ini

A place for users and developers of the Xataface to discuss and receive support.

Filter in relationships.ini

Postby pdesbois » Wed Dec 02, 2009 1:11 am

Hello all,

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.
pdesbois
 
Posts: 9
Joined: Wed Apr 29, 2009 5:21 am
Location: france

Postby shannah » Wed Dec 02, 2009 12:53 pm

Both queries look fine as long as the is_ok field exists.

Not sure what could be happening
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 10 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved