Buy Now
Sign in

Error mysql

webcrea , September 20 2018
webcrea 575
September 20 2018 #380336
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 5.7
September 20 2018 #380344
1
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

You can now copy+paste code from forums
webcrea 575
September 20 2018 #380346
Thanks
You're right
Christophe
http://www.webcrea.fr
webcrea 575
September 20 2018 #380348
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 5.7
September 20 2018 #380349
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

You can now copy+paste code from forums
webcrea 575
September 20 2018 #380350
[h1]1054[/h1][h2]Unknown column 'enrollments.(' in 'where clause' [/h2]
Christophe
http://www.webcrea.fr
healyhatman 5.7
September 20 2018 #380351
)/- 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

You can now copy+paste code from forums