close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

count AS with group by causing error locally

Thread began 3/02/2023 4:39 am by s.joiner74419001 | Last modified 3/09/2023 10:49 am by Ray Borduin | 88 views | 3 replies |

s.joiner74419001

count AS with group by causing error locally

Hi Ray. First and foremost I hope the treatment is going well. No urgency with this but i have an issue with a query that is working on our remote server but fails the page with a 500 error on the local server. I have tried to set PHP version the same on both.
The query is as follows:

<?php
$rsPayments = new WA_MySQLi_RS("rsPayments",$RTMFi,10);
$rsPayments->setQuery("SELECT registered_apps.acc_id, registered_apps.rtm_status, registered_apps.members, application_pcd.date_of_app, application_bi.premises_name, Count(consented_leaseholders.entry_id) AS Countentry_id FROM registered_apps INNER JOIN application_pcd ON registered_apps.app_id = application_pcd.application_id INNER JOIN application_bi ON application_pcd.application_id = application_bi.applicant_id LEFT OUTER JOIN consented_leaseholders ON application_bi.applicant_id = consented_leaseholders.app_id WHERE consented_leaseholders.fee = 'Unpaid' AND registered_apps.product_type != 'CCO' GROUP BY application_bi.premises_name ORDER BY application_pcd.date_of_app DESC");
$rsPayments->execute();
?>
The databases are the same remotely and locally...

I’ve attached screenshots of phpMyAdmin settings for both remote and local servers.

Any idea what’s causing it to fail locally only?

Thanks in advance!
Steve

Sign in to reply to this post

Ray BorduinWebAssist

A 500 error is a general error that means "I'm not showing you the real error".... add this to the top of the page:
<?php
ini_set("display_errors",1);
?>

Then you might get the full error that will point you in the right direction.

Sign in to reply to this post
Did this help? Tips are appreciated...

s.joiner74419001

Hi Ray, I've put error result in a pdf. See attached.

Any ideas on this?

Many thanks
Steve

Attached Files
error_result.pdf
Sign in to reply to this post

Ray BorduinWebAssist

This one is the error:
Fatal error: Uncaught mysqli_sql_exception: Expression #1 of SELECT list
is not in GROUP BY clause and contains nonaggregated column
'db_rtmf.local.registered_apps.acc_id' which is not functionally
dependent on columns in GROUP BY clause; this is incompatible with
sql_mode=only_full_group_by in /Users/stevenjoiner/Sites/
rtmf_root_151122/webassist/mysqli/rsobj.php:221 Stack trace: #0 /Users/
stevenjoiner/Sites/rtmf_root_151122/webassist/mysqli/rsobj.php(221):
mysqli->query('SELECT SQL_CALC...') #1 /Users/stevenjoiner/Sites/
rtmf_root_151122/admin/index.php(38): WA_MySQLi_RS->execute() #2
{main} thrown in /Users/stevenjoiner/Sites/rtmf_root_151122/
webassist/mysqli/rsobj.php on line 221

It explains why it would work on one server and not another. There is a database setting preventing the SQL statement you are running. You can probably just update that setting if you have control of the server, or update the SQL statement to be compatible with that setting and it would still work on both.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...