Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Weird 'A Database Error Occurred' when editing certain entries

July 31, 2014 10:18am

Subscribe [2]
  • #1 / Jul 31, 2014 10:18am

    T2theC

    1 posts

    I have a very strange error as the title suggests. I am hoping someone might have come across it and found a fix.

    On only certain entries, if I edit them, I get:

    A Database Error Occurred
        Unable to connect to your database server using the provided settings.
    
        Filename: core/EE_Config.php
    
        Line Number: 208

    I am using Focus Lab’s config set up. Everything is working perfectly, apart from certain channels.

    EE 2.9
    NginX

    If I try to visit the page on the front end I get an SQL error:

    Error Number: 1064
    
        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 t.entry_date <= AND t.status = 'open' ORDER BY t.sticky desc, t.entry_date ' at line 2
         SELECT t.entry_id FROM exp_channel_titles AS t LEFT JOIN exp_channels ON t.channel_id = exp_channels.channel_id LEFT JOIN exp_members AS m ON m.member_id = t.author_id WHERE t.entry_id !='' AND t.site_id IN ('1') AND t.entry_date < 1406809317 AND (t.expirati OR t.expiration_date > 1406809317) AND t.entry_id = '33' AND t.channel_id = '1' AND t.entry_date >= AND t.entry_date <= AND t.status = 'open' ORDER BY t.sticky desc, t.entry_date desc, t.entry_id desc LIMIT 0, 1
    
        Filename: modules/channel/mod.channel.php
    
        Line Number: 2161

    As mentioned, it is only certain entries and not others. I have figured out that if I run the query in Sequel Pro without

    AND t.entry_date >= AND t.entry_date <=

    It works! The query has no dates. Why would this happen?

    I am guessing that the entry dates have got a little messed up somewhere.

    Anyone have the vaguest clue?

  • #2 / Aug 01, 2014 6:07am

    T2theC

    1 posts

    Anybody?

  • #3 / Sep 24, 2015 6:48am

    ...tumble weeds… did you resolve this?

ExpressionEngine News

#eecms, #events, #releases