i'm working on php and i want insert something in my sql data-base and get the row's inserted primary key in the same time so i've done something like this to insert
$SQL = "INSERT INTO `saisie` (`sid`, `reference`) VALUES (NULL,?)";
$set = $db->prepare($SQL);
$result = $set->execute(array($refCode));
but i don't know what to do to get the sid of that inserted row
you could use this to get the last inserted ID
$id = mysqli_insert_id($db); or
$id = $db->mysqli_insert_id(); or
$id = $db->lastInsertId();