22 Posts
kail
6 years ago
2
Topic

SELECT * FROM #__questions WHERE option= *value* ;

I put this query in field configuration. where option is a column in question table. It resulted in sql error.


But when put

SELECT * FROM #__survey_questions WHERE id <= *value* ; 

it gives desired results. what is wrong in the previous case.

Get a Book for SEBLOD
4229 Posts
Kadministrator
6 years ago
1
Level 1

id is numeric while option is probably text, so you need to wrap it in quotes

SELECT * FROM #__questions WHERE option= "*value*" ;
22 Posts
kail
6 years ago
0
Level 2

thanks Klas

I put: 

SELECT * FROM #__questions WHERE options= "*value*" ;

and received

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 '\"Physics\"' at line 1

Get a Book for SEBLOD