Welcome Guest, Not a member yet? Register   Sign In
What's the fastest way to view the queries that AR is submitting to the MySQL database?
#1

[eluser]Craig N[/eluser]
This is driving me slightly nuts - I wrote a simple delete function in my model that for some odd reason isn't working. It's below:

Code:
function delete_entry($id){
        $this->db->where('id',$id);
        $this->db->delete('candidates');
        return ($this->db->affected_rows() > 0) ? TRUE : FALSE;
    }

I've also tried $this->db->delete('candidates',array('id'=>$id)) and $this->db->query("DELETE * FROM candidates WHERE id='$id'"). Neither of those work either. Adding data and updating data using the same model and db table works fine, so I know it's connecting to the db. I've also echo'd out the id of the item to be deleted to make sure that's passing correctly (it is).

It's gotta be something simple, and I'm thinking that being able to actually see the queries that AR is producing would help figure it out. Any help is appreciated Smile


Messages In This Thread
What's the fastest way to view the queries that AR is submitting to the MySQL database? - by El Forum - 09-18-2008, 02:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB