Buy Now
Sign in

Error mysql

webcrea , September 20 at 08:54
webcrea
Hello,
In this case, if you don't select the first 4 input the mysql WHERE start with AND and produces an error.
Do you know how can i do to solve this issue?
fonds.notreSelection:{data:notre_selection}/-​
​fonds.published:{data:cbox_published}/-​
​fonds.sg_id:{data:select_sg}/-​
​fonds.millesime:{data:select_mille}/-​
​AND​
​( ​
​fonds.natureProduit:{data:select_type}​
​OR ​
​fonds.natureProduit1:{data:select_type}​
​OR ​
​fonds.natureProduit2:{data:select_type}​
​)
Thanks
Regards
Christophe
http://www.webcrea.fr
healyhatman
Pretty sure there's an implicit AND between each line, just get rid of the AND
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman
webcrea
Thanks
You're right
Christophe
http://www.webcrea.fr
webcrea
but this
programs.id:{data:programs_list}/-​
​providers.id:{data:providers_list}/-​
​sessions.id:{data:sessions_list}/-​
​(​
​enrollments.student_first_name:{data:search}/-​
​OR​
​enrollments.student_last_name:{data:search}/-​
​OR​
​enrollments.student_email:{data:search}/-​
​)
produces this error if nothing in search
[h1]1064[/h1][h2]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 'OR OR )' at
line 1 [/h2]
And this without /-
programs.id:{data:programs_list}/-​
​providers.id:{data:providers_list}/-​
​sessions.id:{data:sessions_list}/-​
​(​
​enrollments.student_first_name:{data:search}​
​OR​
​enrollments.student_last_name:{data:search}​
​OR​
​enrollments.student_email:{data:search}​
​)
Show only empty fields
Christophe
http://www.webcrea.fr
healyhatman
Put /- after the closing bracket
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman
webcrea
[h1]1054[/h1][h2]Unknown column 'enrollments.(' in 'where clause' [/h2]
Christophe
http://www.webcrea.fr
healyhatman
)/- like that. Get rid of the /- after the {data:search}
Web developer at SkySpider.com.au
I don't work for ChronoEngine but I do accept donations paypal.me/healyhatman