drews1f
asked on
PHP Union statement has stopped working.
Hello,
I have this UNION statement that was working fine until 2 days ago.
$debtlistq = "(SELECT * FROM mortgage WHERE mort_application_date IS NOT NULL $month_select $quarter_select $year_select) UNION (SELECT * FROM remortgage WHERE mort_application_date IS NOT NULL $month_select $quarter_select $year_select) UNION (SELECT * FROM b2l WHERE mort_application_date IS NOT NULL $month_select $quarter_select $year_select) ORDER BY mort_application_date DESC";
Each Select statement works fine individually and statements 1 and 2 work fine when UNION. But if UNION any other statement with the 3rd statement i dont get any rows outputted.
Is there a line of code i can use to find out where the error is?
Thanks
AR
I have this UNION statement that was working fine until 2 days ago.
$debtlistq = "(SELECT * FROM mortgage WHERE mort_application_date IS NOT NULL $month_select $quarter_select $year_select) UNION (SELECT * FROM remortgage WHERE mort_application_date IS NOT NULL $month_select $quarter_select $year_select) UNION (SELECT * FROM b2l WHERE mort_application_date IS NOT NULL $month_select $quarter_select $year_select) ORDER BY mort_application_date DESC";
Each Select statement works fine individually and statements 1 and 2 work fine when UNION. But if UNION any other statement with the 3rd statement i dont get any rows outputted.
Is there a line of code i can use to find out where the error is?
Thanks
AR
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
good, so, always have a practice of specifying column names instead of using *. That would be a good standard. Please close the question if your issue is solved.
ASKER
i will give you the points as you actually had the right answer ish :)
ASKER
AR