Questions tagged [insert-id]

47 questions
-1
votes
1 answer

msqli db insert id not giving correct value

I've a script that tries to get the insert_id for the autoincrement field I've just inserted. $db = new mysqli("localhost", "user", "pass", "db"); for($xx=0;$xx<$quantity;$xx++){ //quantity is the total…
user1616338
  • 557
  • 1
  • 8
  • 24
-2
votes
1 answer

Value of insert_id keeps returning 0

I'm trying to create a register form where I wish to let the user know the value of his ID. I'm able to successfully register the user but the insert_id keeps returning 0 even though there's multiple rows in the database. Database public function…
Cedric Woo
  • 39
  • 6
1 2 3
4