1

When using SQL through php mysqli prepared statements, is there any delay on an Insert statement?

For example, in this script:

$sql = "INSERT INTO Records (Name, Data) VALUES (?, ?)";
$stmt = $mysqli->prepare($sql);
$stmt->bind_param('ss', $recordName, $data);
$stmt->execute();
echo "INSERT_SUCCESS";

Is the execute() function blocked until the Insert is complete? If I replace the echo line with a Select query, will it find the newly inserted data or will the data still not be there, as the Insert statement was still not executed when the Select statement was queried.

1
  • Not a bad question. The wording is a bit convoluted; take your time asking questions and reread your wording. +1 to remove negative tally. Nov 25, 2015 at 0:26

1 Answer 1

1

PHP is a synchronous language. There is no delay. Except for very few cases, the next line won't execute until the previous is finished

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.