"Database query ERROR" * Please, HELP!!!

Please, help!

Every night my website gets this error:

____________________________________________________________

Database error in Library UA

Query:

SELECT count(ID) as count_id FROM Profiles WHERE DateLastNav > SUBDATE(NOW(), INTERVAL  MINUTE) AND ID=106

Mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ID=106' at line 1

Found error in the file '/home/a9by/public_html/library.ua/inc/admin.inc.php' at line 459.
Called 'fromMemory' function with erroneous argument #2.


Debug backtrace:

Array
(
    [1] => Array
        (
.............
Quote · 5 Oct 2014

It seems your database can't handle the request. You either have not enough available connections to the database, or the load is too high and the database server goes down (or at least becomes unresponsive).

Dedicated servers for as little as $32 (28 euro) - See http://denre.com for more information
Quote · 5 Oct 2014

But after this error website goes down.

I should restore a backup to make site working.

Something crashes.

Quote · 5 Oct 2014

This error is not about the DB connection at all.

Pay attention, that you was already given with exactly explanation of this error:

Mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ID=106' at line 1

Now - look atain at your query:

SELECT count(ID) as count_id FROM Profiles WHERE DateLastNav > SUBDATE(NOW(), INTERVAL  MINUTE) AND ID=106

and, just find the mentioned problem:

near ') AND ID=106'

Thus, your error is that the value (of interval) is missing:

INTERVAL  MINUTE

There must be a digit between these two words, example:

INTERVAL 5 MINUTE

 

In this case, your final query:

SELECT count(ID) as count_id FROM Profiles WHERE DateLastNav > SUBDATE(NOW(), INTERVAL 5 MINUTE) AND ID=106

will work without any error

Quote · 5 Oct 2014

So I must ask the question, "What caused the interval to be missing?"  If this is standard Dolphin code that the user has not manipulated, then my question.  Is the interval a setting somewhere that is not being set?  A bit more information to the OP would be helpful here.

Geeks, making the world a better place
Quote · 5 Oct 2014

 

So I must ask the question, "What caused the interval to be missing?"  If this is standard Dolphin code that the user has not manipulated, then my question.  Is the interval a setting somewhere that is not being set?  A bit more information to the OP would be helpful here.

I remember a bug where Dolphin would sometimes calculate the number of items per page (and something else, can't remember the full details right now), and in some cases, the math would result in a negative number. This would then throw a similar MySQL error. They later added a check so this doesn't happen.

 

So it can happen, at least if you change a bunch of things.

BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin
Quote · 5 Oct 2014

Go into Admin then to Settings, then advanced settings then profiles. Look at the option Online status timeframe (minutes):

What is the current value?  It should be 1

https://www.deanbassett.com
Quote · 5 Oct 2014

Thank you all, guys!!!

And...  Thank you, Deano!

In this field I had NOTHING. It was empty. 

I deleted this value same days ago (and I forgot about it, couse I made many diffirent options), but I didn't think that it will make such problems!

ADVISE: I think that it will be usefull for Boonex-Fathers to prohibit empty field "Online status timeframe" to avoid such situations for other users in future.

Go into Admin then to Settings, then advanced settings then profiles. Look at the option Online status timeframe (minutes):

What is the current value?  It should be 1

 

Quote · 5 Oct 2014

There are also a few places where if you put zero into a field, it will create a division by zero error and maths hate it when you try to divide by zero.

Geeks, making the world a better place
Quote · 5 Oct 2014

 

This error is not about the DB connection at all.

Pay attention, that you was already given with exactly explanation of this error:

Mysql error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ID=106' at line 1

Now - look atain at your query:

SELECT count(ID) as count_id FROM Profiles WHERE DateLastNav > SUBDATE(NOW(), INTERVAL  MINUTE) AND ID=106

and, just find the mentioned problem:

near ') AND ID=106'

Thus, your error is that the value (of interval) is missing:

INTERVAL  MINUTE

There must be a digit between these two words, example:

INTERVAL 5 MINUTE

 

In this case, your final query:

SELECT count(ID) as count_id FROM Profiles WHERE DateLastNav > SUBDATE(NOW(), INTERVAL 5 MINUTE) AND ID=106

will work without any error

 You're so right, should have read better

Dedicated servers for as little as $32 (28 euro) - See http://denre.com for more information
Quote · 5 Oct 2014

Indeed,

All MySQL errors are always clearly explained by the mysql itself, so, we just need to read this explanation carefully (at least, this is always in english)  :-)

Quote · 6 Oct 2014

http://www.boonex.com/trac/dolphin/ticket/3459

ADVISE: I think that it will be usefull for Boonex-Fathers to prohibit empty field "Online status timeframe" to avoid such situations for other users in future.

 

Rules → http://www.boonex.com/terms
Quote · 8 Oct 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.