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

[eluser]Michael;[/eluser]
OMG! I'm going to kick myself for the next month on this one.

Derek, I apologize, but I have wasted your time here because I made a stupid mistake... If you look at that function again, there is a typo in the function .. a silly, and complete moronic typo. I should learn not code for 18 hours straight day in and day out.

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; }
    }

That is the correct function... notice the () after $this->db->affected_rows(). Yeah, I left them off originally.

*smacks forehead* I've been starring at this code for 2 hours trying to figure out WTH.

*sighs*

Sorry again Derek... Thank you for your help.


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