Page 2 of 2

Re: PHP/MySQL Query help with Two Tables

Posted: Tue Nov 17, 2009 11:37 am
by julzk
WOOOOT!!

Code: Select all

$result = mysql_query("SELECT
            j.jobs_id,
            j.jobs_description,
            d.jobs_done_id,
            d.jobs_timedone,
            d.jobs_comment,
            d.jobs_user
        FROM tbl_jobs AS j
        LEFT JOIN tbl_jobs_done AS d
            ON j.jobs_id = d.jobs_id
            AND DATE(d.jobs_date) = DATE(NOW()+INTERVAL 16 HOUR)
        WHERE j.jobs_datetype IN('$everyday', '$dayname', '$wtype')
        ORDER BY jobs_id ASC");
That fixed it! It now clears the old jobs from yesterday and displays new jobs for the next days :)

Re: PHP/MySQL Query help with Two Tables

Posted: Tue Nov 17, 2009 11:45 am
by iankent
julzk wrote:That fixed it! It now clears the old jobs from yesterday and displays new jobs for the next days :)
Glad it worked, but just one thing - doesn't AEDT = UTC + 11:00? In which case using + 16 HOUR will put you 5 hours too far ahead, i.e. you'll see items from 19th at 7pm on 18th