Shamsul Kamal
asked on
How to combine 2 mysql query ?
Hi,
May i know how to combine these 2 mysql query in one go ?
relid = 'x' , x is the "id" in "SELECT * FROM tblhosting"
Both are in the same database but 2 separate table.
If using mysql query is not possible, please help me to construct in PHP query.
Thank you.
May i know how to combine these 2 mysql query in one go ?
SELECT * FROM tblhosting WHERE nextduedate > nextinvoicedate;
SELECT * FROM tblinvoiceitems INNER JOIN tblinvoices ON tblinvoiceitems.invoiceid = tblinvoices.id WHERE relid = 'x' AND STATUS = 'unpaid';
relid = 'x' , x is the "id" in "SELECT * FROM tblhosting"
Both are in the same database but 2 separate table.
If using mysql query is not possible, please help me to construct in PHP query.
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What resolution are your dates stored at? Perhaps the issue is this statement:
Maybe what you need is something like:
tblhosting.nextduedate > tblhosting.nextinvoicedate
Maybe what you need is something like:
tblhosting.nextduedate >= tblhosting.nextinvoicedate
ASKER
Thank you
ASKER
I have tried the following :
Open in new window
But the output seems wrong.
Can anybody spot the problem and help me ?
Thank you.