[SOLVED] Â Mysql query works in PHPadmin but not in program |
4/27/2017 3:39:53 PM |
PHPRunner General questions | |
M
Mark Kramer author
Hello.. |
|
![]() |
Admin 4/27/2017 |
You are shooting yourself in the foot. PHP allows multiline strings so you can just use your query as is without extra quotes, dots or line breaks. |
M
|
Mark Kramer author 4/27/2017 |
You are shooting yourself in the foot. PHP allows multiline strings so you can just use your query as is without extra quotes, dots or line breaks.
|
M
|
Mark Kramer author 4/28/2017 |
So.... This is the actual query: REPLACE INTO inntel5_camp.Room_Ins_Global (Cabin,Date,Total_Score) SELECT CabinInfo .Cabincode ,Room Inspection .Week Ending ,Room Inspection .Total Score FROM Room Inspection , CabinInfo WHERE ( Room Inspection .Week Ending >= now() - INTERVAL 500 DAY) AND (Room Inspection .Pass/Fail ='Fail')GROUP BY Room Inspection .Week Ending , Room Inspection .Total Score , Room Inspection .Pass/Fail ORDER BY Room Inspection .Week Ending DESCHow do I integrate it like this? @sql= REPLACE INTO inntel5_camp.Room_Ins_Global (Cabin,Date,Total_Score) SELECT CabinInfo .Cabincode ,Room Inspection .Week Ending ,Room Inspection .Total Score FROM Room Inspection , CabinInfo WHERE ( Room Inspection .Week Ending >= now() - INTERVAL 500 DAY) AND (Room Inspection .Pass/Fail ='Fail')GROUP BY Room Inspection .Week Ending , Room Inspection .Total Score , Room Inspection .Pass/Fail ORDER BY Room Inspection .Week Ending DESCCustomQuery($sql); |
H
|
headingwest 4/28/2017 |
Couple of suggestions:
|
M
|
Mark Kramer author 4/28/2017 |
Couple of suggestions:
|