By somes on
This mysql statement is not correct and generating syntax errors
can anyone give me pointers on fixing it
SELECT ff.field_survey_value FROM {field_data_field_survey} ff JOIN {node} n ON n.nid = ff.entity_id WHERE n.uid = 1 AND n.type = 'article'
Comments
Seeing the error and your
Seeing the error and your code would help.
Heres the error #1064 - You
Heres the error
#1064 - 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 '} ff JOIN {node} n ON n.nid = ff.entity_id WHERE n.uid = 1 AND n.type = 'article' at line 1
and the query
SELECT ff.field_survey_value FROM {field_data_field_survey} ff JOIN {node} n ON n.nid = ff.entity_id WHERE n.uid = 1 AND n.type = 'article'
How are you invoking the
How are you invoking the query, I would suspect you should be using db_query().
Im running it directly in the
Im running it directly in the SQL command window of phpadmin
I took the template from the unit testing of the commerce module as I need to access some custom fields on a node in this case article but i need a join on the tables -
I cant figure it out - Im missing something very trivial
tks
M
yeh the syntax changes
SELECT ff.field_survey_value FROM field_data_field_survey AS ff JOIN node AS n ON n.nid = ff.entity_id LIMIT 0 , 30
this works for me
M
The {} braces are a Drupal
The {} braces are a Drupal feature for table names to support prefixing. They are only valid when using the Drupal db API.