this is driving me nuts...why doesn't this line work ?
PHP Code:
$sql "select * from answers WHERE unit = $unit
AND section = 
$section AND question = $question AND
group = '2' AND correct = 'y' ORDER By rand() LIMIT 1"

i have tried it as "group = $question", "group = 2", "group = ''", "group = 'y'", etc... taking out the group part of the query, it always runs fine...anytime i add it i get
You have an error in your SQL
syntax near 'group = '2' AND correct = 'y' ORDER By
rand() LIMIT 1' at line 1
this group column is the same crap as unit, section, question...all int(11)s. i.e., this works fine:
PHP Code:
$sql "select * from answers WHERE
unit = 
$unit AND section = $section AND question =
$question AND correct = 'y' ORDER By rand() LIMIT 1"
any ideas ? thanks,

Geoff