ExpressionEngine CMS
Open, Free, Amazing

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.

setting sql_mode per session basis

October 11, 2010 2:54am

Subscribe [2]
  • #1 / Oct 11, 2010 2:54am

    jackmcpickle

    21 posts

    Hi

    Mt host is running php5.2 / sql 5 but currently using the following mode:
    sql_mode STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

    I have access to phpmyAdmin but not enough privilages to change the mode. I know you can change the mode on a per session basis.

    Is it possible to set the sql_mode in the db.mysql.php??

    Found these few articles on changing for wordpress but cant figure out what I need to do for EE. Really going out on a limb here and just trying to get something working.

    http://rpbouman.blogspot.com/2007/04/so-wordpress-does-not-like-mysql-sql.html
    http://rpbouman.blogspot.com/2007/04/guess-whatwordpress-does-not-like.html

    function db_connect($select_db = TRUE)
        {    
    
            $this->conn_id = ($this->conntype == 0) ?
              @mysql_connect ($this->hostname, $this->username, $this->password):
              @mysql_pconnect($this->hostname, $this->username, $this->password);
    
            // fix sql_mode 
                    mysql_query("SET SESSION SQL_MODE := ''",$this->database);
            // end fix sql_mode


    Thanks.

  • #2 / Oct 11, 2010 3:40pm

    Ingmar

    29245 posts

    Is it possible to set the sql_mode in the db.mysql.php??

    I honestly don’t know. It would certainly require some hacking of EE core files, which we’re unable to support. Perhaps you could upgrade to EE 2.1? It no longer has the “no strict mode” requirement.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases