Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

268
Views
Obtenga la clave principal de la última fila insertada en php

estoy trabajando en php y quiero insertar algo en mi base de datos sql y obtener la clave principal insertada de la fila al mismo tiempo, así que hice algo como esto para insertar

 $SQL = "INSERT INTO `saisie` (`sid`, `reference`) VALUES (NULL,?)"; $set = $db->prepare($SQL); $result = $set->execute(array($refCode));

pero no sé qué hacer para obtener el sid de esa fila insertada

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

podría usar esto para obtener la última identificación insertada

 $id = mysqli_insert_id($db); or $id = $db->mysqli_insert_id(); or $id = $db->lastInsertId();
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!