Posted by Jeff on 01/22/07 19:01
Hey
I use php 5.2.0 and via this php code I call a stored procedure (see the
code below):
This stored procedure inserts a new record into table (mysql5 database). The
problem is that $db->insert_id don't give the id of the newly inserted
record in the table, it gives the value 0
This is the declaration of the primary key column on this table
Id int unsigned not null auto_increment primary key
$sql = "call SaveProperty(".$_SESSION['userId'].", '".$adresse."')";
echo $sql;
$result = $db->query($sql);
echo "NEW ID = ".$db->insert_id;
if (mysqli_errno($db))
{
$error = mysqli_error($db);
echo $error;
}
Any suggestions?
[Back to original message]
|