Broken query
| From: | Ron Piggott | Date: | Sun, 11 Jul 2010 12:23:00 +0000 |
| Subject: | Broken query | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-47255@lists.php.net to get a copy of this message | ||
I am trying to write a query to select a trivia question, but I don't want
the trivia question category to be the same two days in a row so I added a
second "SELECT" syntax to find out what category was used yesterday. This
works when I test it "live", but doesn't work when it is part of a cron
job. How do I get the value of
Bible_trivia_category_reference from the
second SELECT query to be used in the first? What change is needed? Ron
SELECT * FROM verse_of_the_day_Bible_trivia WHERE assigned_date =
'0000-00-00' AND seasonal_use = $bible_trivia_application AND
live =1
AND NOT Bible_trivia_category_reference = ( SELECT
Bible_trivia_category_reference FROM verse_of_the_day_Bible_trivia
WHERE assigned_date = '$last_mailing_date' LIMIT 1 ) ORDER BY RAND()
LIMIT 1