Answer the question
In order to leave comments, you need to log in
Can you help me with PDO, LastInsertId and INSERT ON DUPLICATE KEY UPDATE?
Hello,
I am making a request:
$param = 1;
$sql = "INSERT INTO orders(param,unic_cell) VALUES (?,1) ON DUPLICATE KEY UPDATE param=?";
$query = $pdo->prepare($sql);
$query->execute(array($param,$param));
echo $pdo->lastInsertId();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question