0

I am trying to prepare an insertion inside the database with php, but i can't find any suggestions on how to use the syntax, this is what I've got so far, could someone help me with this please?

   $last_id = mysqli_insert_id($conn);

   $query = $conn->prepare("INSERT INTO `table`(name, surname) VALUES (?,?) , (?,?)");

   $query->bind_param("ss", ($nameOne, $last_id), ($nametWO, $last_id));
Dharman
  • 30,962
  • 25
  • 85
  • 135

1 Answers1

1

the binding should be

$query->bind_param("ssss", $nameOne, $last_id, $nametWO, $last_id);
Dharman
  • 30,962
  • 25
  • 85
  • 135
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107