I've decided to have an automated script pick the highest rated joke and sms message at the end of every month. Here is the query that I have tried for the jokes part:
INSERT INTO `phpbb_content_top` ( `oldid` , `title` , `author` , `author_id` , `warning` , `score` , `type` , `date` )
SELECT `id` , `title` , `author` , `author_id` , `warning` , (
score / votes
) AS `score` , 'jokes', '04-04-04'
FROM `phpbb_content_jokes`
ORDER BY (
score / votes
) DESC
LIMIT 1
However, the date, score and type are not entered (the joke does not have a warning.) If unsure see screenshot.
I'm also running what I feel to be an identical query for the sms section:
INSERT INTO `phpbb_content_top` ( `oldid` , `title` , `author` , `author_id` , `warning`, `score`, `type`, `date`)
SELECT `id` , `title` , `author` , `author_id` , `warning`, (score/votes) AS `score`, 'sms', '04-04-04'
FROM `phpbb_content_sms`
ORDER BY (
score / votes
) DESC
LIMIT 1
which leads to everything being added successfully.
What am I doing wrong?