I bet I'm missing something obvious on this one, but I'm stumped.
I have the daily mail going out on Monday Wed and Friday, so I changed the
sub getDailyMail a bit to pull out stories 2 days back. So my query looks
select stories.sid, stories.title, stories.section,
stories.tid, stories.time, stories.dept,
FROM stories, story_text, users
WHERE TO_DAYS(time) >= TO_DAYS(NOW() - INTERVAL 2 DAY)
AND TO_DAYS(time) <= TO_DAYS(NOW())
AND users.uid=stories.uid AND stories.sid=story_text.sid
ORDER BY stories.time
SO my problem is when I run this from the command line, all is well. When
slashcode runs the task, it pulls out ALL the stories, it doesn't pay any
attention to the date for some reason.
Do the tasks get date stuff from somewhere I'm not seeing?
Librarian & Information Science News
lists@... (Blake Carver) writes:
> SO my problem is when I run this from the command line, all is
> well. When slashcode runs the task, it pulls out ALL the stories,
> it doesn't pay any attention to the date for some reason.
Turn on query logging for your mysql, by putting this (or similar)
in the [mysqld] section of your my.cnf file:
log =3D /var/log/mysql/mysql.log
Then shut down apache and slashd, restart mysqld, and use runtask
to run just the task you're interested in. Then scan the log
file to see what query is actually getting executed. The nice
thing is that you can know exactly what the query is doing by
copying it out of the log file and pasting it into a mysql client
(maybe precede it with EXPLAIN if you are really confused :).
Get latest updates about Open Source Projects, Conferences and News.