Welcome Guest, Not a member yet? Register   Sign In
Problem with insert
#1

[eluser]Unknown[/eluser]
I have a problem with this insert funcion

function inserirCategoria($id_pare,$nom,$actiu,$ordre) {
$nou_ordre=$ordre+1;

$categoria = array ('nom' => $nom,
'id_pare' => $id_pare,
'actiu' => $actiu,
'ordre' => $nou_ordre);

$this->db->insert('categories', $categoria);

return $this->db->insert_id();

}

In database 'id_pare' is an integer and the function always insert 0,but $id_pare have the correct value.What´s the problem?Because reading codeigniter user guide I think the array is correctly made
#2

[eluser]Andreas Krohn[/eluser]
What does your database table look like?
#3

[eluser]Unknown[/eluser]
I have found the solution,thank you




Theme © iAndrew 2016 - Forum software by © MyBB