This topic is locked

My Query works in MySQL Command but erro in PHPRunner Result

11/7/2016 11:22:20 AM
PHPRunner General questions
J
jackwood author

I have table booking :

BookID, RoomType, room, Checkin, Checkout
I want to show Summary List of Guest in house per RoomType, so I have query which I run in my MySQL Command it work well

-------------------------------------------------------------------------------------------

SELECT B.Checkin + INTERVAL num DAY Tanggal,

roomtype,

count(room) as Jumlah FROM

(SELECT tth10000+th1000+h100+t10+u num FROM

(SELECT 0 tth UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4

UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) TTHN,

(SELECT 0 th UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4

UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) THN,

(SELECT 0 h UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4

UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) HN,

(SELECT 0 t UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4

UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) TN,

(SELECT 0 u UNION SELECT 1 UNION SELECT 2 UNION SELECT 3 UNION SELECT 4

UNION SELECT 5 UNION SELECT 6 UNION SELECT 7 UNION SELECT 8 UNION SELECT 9) UN) A,

bookingdetails B

WHERE B.Checkin + INTERVAL num DAY <= B.Checkout

group by tanggal,roomtype;

-----------------------------------------------------------------------------------------------
thats query doesn't work if I build to PHPRunner, Cannot run query in a browser.

Sergey Kornilov admin 11/7/2016

PHPRunner doesn't support UNION queries. Create a view in MySQL on the top of this SQL query and use this view as a datasource in PHPRunner.

J
jackwood author 11/8/2016



PHPRunner doesn't support UNION queries. Create a view in MySQL on the top of this SQL query and use this view as a datasource in PHPRunner.


Hi Sergey,

Thanks for reply.
IF I execute thats query is Running, But If I Create View there was an Error:
[Err] 1349 - View's SELECT contains a subquery in the FROM clause. Is that MySql Limitation ?

Sergey Kornilov admin 11/8/2016