Welcome Guest, Not a member yet? Register   Sign In
$this->db->affected_rows() doesnt return no. rows deleted???
#1

[eluser]the real rlee[/eluser]
Hi guys, i was reading the user guide and supposedly an inbuilt hack in the Active Record class for mysql should make $this->db->affected_rows() return the actual rows deleted...But i cant seem to get it to do so. My sql definitely deletes the record

Code:
$this->db->delete('gallery_photo', array('gallery_photo_id' => (int)$gallery_photo_id));
        $affected_rows = $this->db->affected_rows();
        if ($affected_rows == 0) {
            show_error('Gallery Model: Invalid photo ID ('.$gallery_photo_id.') unable to delete photo (affected rows: '.$this->db->affected_rows().')');
            log_message('error', 'Gallery Model: Invalid photo ID ('.$gallery_photo_id.') unable to delete photo.');
        }

Am i missing something?


Messages In This Thread
$this->db->affected_rows() doesnt return no. rows deleted??? - by El Forum - 08-07-2007, 10:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB