I have following query:
$query="SELECT language_value, votes, user_id FROM labels WHERE approved=1 AND label_value=".
$data[$i]['label_value']." AND language=".$language_id;
I have got the error:
Error Number: 1054
Unknown column 'AccountPagesView.a_book' in 'where clause'
But ‘AccountPagesView.a_book’ is value of $data[$i][‘label_value’] and isn’t a column. Where have I made a mistake?
You should enclose any string values in MySQL in
':(I just took a guess, which are string-like columns.)
EDIT
As pointed out by @vstm: make sure the the values, you insert here, are properly escaped.