Welcome Guest, Not a member yet? Register   Sign In
Active Record class update() return ?
#8

[eluser]tomcode[/eluser]
Quote:Never has for me, if nothing is updated it doesnt return TRUE

@thepyromaniac: This is very strange. Can You give Your environnement ?
I'm working on WinXP under
Apache/2.2.3 (Win32) PHP/5.2.0 MySQL/5.0.22
Apache/1.3.33 (Win32) PHP/4.3.10 MySQL/3.23.49

I've checked again the code:

the update() method:
returns FALSE or exists (with $this->db_debug enabled) if one of its params aint valid.

else it 'just' returns the central query() method:

returns FALSE or exists (with $this->db_debug enabled) if one of its params aint valid.
returns $this->CACHE->read($sql) if cache is on
returns FALSE if $this->simple_query($sql) returns false
returns TRUE for write_type queries
returns TRUE if param $return_object (the third one) is other than TRUE
returns the created result object new 'CI_DB_'.$this->dbdriver.'_result'

That's it.

The comment: (which omits to mention the third param)

Code:
<?php
    /**
     * Execute the query
     *
     * Accepts an SQL string as input and returns a result object upon
     * successful execution of a "read" type query.  Returns boolean TRUE
     * upon successful execution of a "write" type query. Returns boolean
     * FALSE upon failure, and if the $db_debug variable is set to TRUE
     * will raise an error.
     *
     * @access    public
     * @param    string    An SQL query string
     * @param    array    An array of binding data
     * @return    mixed        
     */    
    function query($sql, $binds = FALSE, $return_object = TRUE)
    {

I get the behaviour as decribed in the comment above.


Messages In This Thread
Active Record class update() return ? - by El Forum - 01-06-2008, 10:53 AM
Active Record class update() return ? - by El Forum - 01-06-2008, 11:19 AM
Active Record class update() return ? - by El Forum - 01-06-2008, 11:28 AM
Active Record class update() return ? - by El Forum - 01-06-2008, 02:51 PM
Active Record class update() return ? - by El Forum - 01-06-2008, 02:57 PM
Active Record class update() return ? - by El Forum - 01-06-2008, 03:08 PM
Active Record class update() return ? - by El Forum - 01-07-2008, 06:36 AM
Active Record class update() return ? - by El Forum - 01-07-2008, 08:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB