Hi everyone
I know how to pass $_GET['id'] variable to sql query. It is like this:
SELECT historical_epoch, picture_link, picture_title, picture_author
FROM historical_epochs
WHERE id = {$_GET['id'])};
and this:
SELECT questions.id, questions.question
FROM epochs JOIN questions
ON epochs.id = questions.epoch_id
AND epochs.id = {$_GET['id'])}
ORDER BY RAND()
LIMIT 2;
But how to pass something else eg. 'answers.question_id = 3' to sql query? What should I do with 'answers.question_id = 3'?
SELECT answer, boolean_type FROM questions JOIN answers
ON questions.id=answers.question_id
WHERE [B]answers.question_id = 3[/B] ORDER BY RAND();
Please help.
Thanks in advance for yours reply.