I'm creating an invoice script where you can record invoices. Here are some of the fields in my mysql database:
inv_day
inv_month
inv_year
inv_paid
inv_due
inv_total
In the inv_day, inv_month and inv_year fields, I have numbers. E.g: 20 10 2004
inv_paid is a number how much has been paid. E.g: 100
inv_due is a number how much is to be paid. E.g: 200
inv_total is the total amount that will end up being paid. E.g: 300
Ok, now what I want to do is display outstanding invoices. Outstanding invoices are invoices where the inv_day, inv_month and inv_year are less or equal to the current day you are viewing the script.
Here is my query:
Code: Select all
select * from {$tbl_name}invoices where inv_month<='$this_month' and inv_year<='$this_year' and inv_paid < inv_total and (inv_due!='0' or inv_due!='0.00' or inv_due!='') order by added descSome fields work and some fields, that should work, don't...
Is there anything wrong with my code or is there anything that will make it work better?
feyd | made topic a little more relevant and helpful.