I have two tables "tbl_jobs" and "tbl_jobs_done"
Here are the fields for both tables:
tbl_jobs
-jobs_id
-jobs_description
-jobs_datestart
-jobs_dateend
-jobs_datetype
-jobs_user
-jobs_updateuser
tbl_jobs_done
-jobs_done_id
-jobs_id
-jobs_date
-jobs_comment
-jobs_datedone
-jobs_timedone
-jobs_user
How this works is, I have an SQL Query which goes something like this:
Code: Select all
$result = mysql_query("SELECT * FROM tbl_jobs WHERE jobs_datetype IN('$everyday', '$dayname', '$wtype') ORDER BY jobs_id ASC");How I want it to display is, it will by default check the jobs_id field from both tables to see if it has been done and by current date yyyy-mm-dd within the jobs_date field in tbl_jobs_done (
Code: Select all
using something like $dayname=date('l');Is there anyway I can do this? Let it be within PHP else/if statements or the SQL query itself?