PHP Error [SOLVED]
Posted: Wed Mar 17, 2010 12:23 pm
Hi,
I'm trying to add a new record into one of my tables. (In this instance, called "ContractData".) If I use drop down menus to populate 2 of the fields (CompanyName and SiteName - which are taken from other tables) then everything is fine when I insert the record. However, if I have (instead of a drop down menu) a multiple select type menu (tick box, advmultiselect, etc) then it throws an error (even if I still only select one option)
I really want to be able to select multiple options for SiteName so that each multiple SiteNames can have the same ContractID (I guess I may need some relationship stuff here)..but at the moment, I can't even use a multi select type box to populate even when only selecting one option.
Can anyone help at all?
Thanks
Paul
I'm trying to add a new record into one of my tables. (In this instance, called "ContractData".) If I use drop down menus to populate 2 of the fields (CompanyName and SiteName - which are taken from other tables) then everything is fine when I insert the record. However, if I have (instead of a drop down menu) a multiple select type menu (tick box, advmultiselect, etc) then it throws an error (even if I still only select one option)
- Code: Select all
PHP Fatal error: 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 '' at line 1SELECT COUNT(*) as num FROM `ContractData` WHERE `ContractRecordID` = '8' AND `ContractType` LIKE CONCAT('%','5','%') AND `ContractLength` LIKE CONCAT('%','12','%') AND `ContractStartDate` LIKE CONCAT('%','2010-03-17','%') AND `ContractEndDate` LIKE CONCAT('%','2011-03-17','%') AND `ContractActive` LIKE CONCAT('%','NO','%') AND `ContractStatus` LIKE CONCAT('%','New','%') AND `ContractSupplier1` LIKE CONCAT('%','1','%') AND `ContractStandingCharge` LIKE CONCAT('%','1','%') AND `ContractDayRate` LIKE CONCAT('%','1','%') AND `ContractNightRate` LIKE CONCAT('%','1','%') AND `ContractCommissionType` LIKE CONCAT('%','1','%') AND `ContractCommissionRate` LIKE CONCAT('%','1','%') AND `CompanyName` LIKE CONCAT('%','PaulGray','%') ANDOn line 127 of file /var/www/html/public/dataface/Dataface/QueryTool.php in function printStackTrace()\n<br>On line 524 of file /var/www/html/pub in /var/www/html/public/dataface/Dataface/QueryTool.php on line 127
I really want to be able to select multiple options for SiteName so that each multiple SiteNames can have the same ContractID (I guess I may need some relationship stuff here)..but at the moment, I can't even use a multi select type box to populate even when only selecting one option.
Can anyone help at all?
Thanks
Paul