Welcome Guest, Not a member yet? Register   Sign In
$this->db->affected_rows()
#1

[eluser]Michael;[/eluser]
I have the following code in my model:

Code:
function add_topic($_POST) {
      $topic_add = $this->db->query("INSERT INTO forum_topics (board_id, user_id, topic, dt_create, dt_update) VALUES ('".$this->dot_common->dbsafe($_POST['board_id'])."', '".$this->dot_common->dbsafe($_SESSION['uid'])."', '".$this->dot_common->dbsafe(trim(htmlspecialchars($_POST['topic'])))."', UNIX_TIMESTAMP(), UNIX_TIMESTAMP())");
      if ($this->db->affected_rows > 0) { $topic_id = $this->db->insert_id(); return $topic_id; } else { return $topic_id = 0; }
    }

$this->db->affected_rows() will *NOT* return a result... pull it out and the function works fine.

I searched the forums but could not find any bug reports... is this something new? Anyone else have a problem?

CI v1.6.1

Thanks.


EDIT: Spelling


Messages In This Thread
$this->db->affected_rows() - by El Forum - 03-19-2008, 07:33 PM
$this->db->affected_rows() - by El Forum - 03-19-2008, 07:59 PM
$this->db->affected_rows() - by El Forum - 03-19-2008, 08:35 PM
$this->db->affected_rows() - by El Forum - 03-19-2008, 08:41 PM
$this->db->affected_rows() - by El Forum - 03-19-2008, 08:43 PM
$this->db->affected_rows() - by El Forum - 03-19-2008, 08:46 PM
$this->db->affected_rows() - by El Forum - 03-19-2008, 08:58 PM
$this->db->affected_rows() - by El Forum - 03-21-2008, 07:22 PM
$this->db->affected_rows() - by El Forum - 03-21-2008, 09:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB