Page 1 of 1

SQLSTATE[08004] [1040] Too many connections

Posted: Fri Nov 24, 2023 6:52 pm
by stevenmiller
Hi Forum,

I'got a table properties with 240 columns and about 500 entries and a second table tenants with about 50 columns and 2000 entries. Everything works fine, but when I want to edit a report where the SQL - statement is like

SELECT * FROM properties, tenants WHERE '#property_id#' = tenants_property_id

and I open the Report Designer, the server freezes and this message is shown in the frontend, as no #property_id# is chosen in the Report Designer and all entries are loaded.

Connection to the nuBuilder database failed: SQLSTATE[08004] [1040] Too many connections

Verify and update the settings in nuconfig.php

Restart your browser after modifying nuconfig.php in order for changes to be reflected


In the GUI everything works fine, as the report is called from an edit form, where the property_id is selected.
What can I do to not start too many connections as the maximum is already set to 500.

Thanks.
Steven

Re: SQLSTATE[08004] [1040] Too many connections

Posted: Wed Nov 29, 2023 7:56 am
by kev1n
Hi,

Would and SQL like this work?

Code: Select all

SELECT * FROM properties, tenants WHERE 
'#property_id#' = tenants_property_id OR ('#property_id#' LIKE '#%' AND FALSE)
Basically, if the Hash Cookie property_id is not set, no rows are selected.