This topic is locked
[SOLVED]

 PHPR5.2b - Bug Report - SQL query problems

12/26/2009 2:15:08 PM
PHPRunner General questions
J
Jepsen author

The following query works perfectly in MySQL:

SELECT

`user`,

COUNT(`ip`) AS `ip`

FROM db_connects

WHERE `user` <> '' AND `user` <> 'Guest'

GROUP BY `user`

ORDER BY `ip` DESC

LIMIT 25


When using it in the PHPR it shows correst when pressing "Result" tab, but the limit statement is ignored when outputting for my chart.
If I click "Query Designer" and return to "SQL", the LIMIT statement have gone.
If I click "NEXT" from the "SQL" tav, I get a warning saying " ORDER BY fields must match SELECT fields. You may let Runner to fix SQL query automaticly or fix it by hand." And then O get 4 options with following results:
I hope my description is such, that you understand the problem.

J
Jane 12/28/2009

Morten,
unfortunately LIMIT statement is not supported in PHPRunner.

As workaround you can create view in the database using this query and add this view to the PHPRunner project.

J
Jepsen author 12/29/2009

Jane
I am not a pro, and i didn't have the faintest idea about views.
Now I have just made my first view in MYSQL and created an application in PHPR 5.2b to work with it. It works perfectly.
This solves not only the current issue, but many others with it. Elegant. Thanks to MySQL for making views and thanks to you Jane for pointing me to them.
Happy new year.



Morten,
unfortunately LIMIT statement is not supported in PHPRunner.

As workaround you can create view in the database using this query and add this view to the PHPRunner project.