although this does not make any difference to the functionality it would be better if these were changed and would make the code easier to read.
see how the workorders is primary. This is taken from display_workorders()
verify this is how it should be done. Have I got them the right way around, ie should workorder be primary?
Bad
LEFT JOIN ".PRFX."user_records ON ".PRFX."user_records.user_id = ".PRFX."workorder_records.employee_id
LEFT JOIN ".PRFX."client_records ON ".PRFX."client_records.client_id = ".PRFX."workorder_records.client_id
Bad
LEFT JOIN ".PRFX."user_records
ON ".PRFX."user_records.user_id = ".PRFX."workorder_records.employee_id
LEFT JOIN ".PRFX."client_records
ON ".PRFX."client_records.client_id = ".PRFX."workorder_records.client_id
Good
LEFT JOIN ".PRFX."user_records ON ".PRFX."workorder_records.employee_id = ".PRFX."user_records.user_id
LEFT JOIN ".PRFX."client_records ON ".PRFX."workorder_records.client_id = ".PRFX."client_records.client_id
Good
LEFT JOIN ".PRFX."user_records
ON ".PRFX."workorder_records.employee_id = ".PRFX."user_records.user_id
LEFT JOIN ".PRFX."client_records
ON ".PRFX."workorder_records.client_id = ".PRFX."client_records.client_id
http://www.sql-join.com/sql-join-types/
these both show you use the primary table fist in the ON statement and when you consider LEFT JOIN this also make logical sense to lay it out because the item on the left is primary and you want all readys from that and any mathcing ones from the right.
although this does not make any difference to the functionality it would be better if these were changed and would make the code easier to read.
see how the workorders is primary. This is taken from display_workorders()
verify this is how it should be done. Have I got them the right way around, ie should workorder be primary?
Bad
Bad
Good
Good