problems with php variables in mysql query

Posted on 16th Feb 2014 by admin

i can't seem to get the following query to work.

select $q1c from $vote_rate where id = $recent_record LIMIT 0,1 ;

this method did not work either
select .$q1c. from .$vote_rare. where id = .$recent_record. LIMIT 0,1 ;

i did get

$q_o = " AND id=".$rand." ORDER BY id asC LIMIT 1";
"SELECT ".$answer2." FROM vote_rare WHERE".$q_o;

to run, i.e. not crash my script

but then i don't get any result from $answer_db = $row['$answer2'];

any ideas?

Other forums