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:
PHP:
---------------------------------------------------------------------------
-----
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:
PHP:
---------------------------------------------------------------------------
-----
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.
The table types that they are both being selected from are not identical and that is the only thing that I can see that is different between the two...
phpbb_content_sms (works)
phpbb_content_jokes (does not work)
- Anthony