Ich versuche, meine SQL-Tabelle mit Hilfe dieses PHP-Code zu aktualisieren:PHP mysqli Befehl kann jetzt nicht seinen Fehler ausgeführt
$description = "Something about myself";
$insert = $con->prepare("INSERT INTO kys_write (Author, writing , Title , Description , Assets) VALUES (?,?,?,?,?)");
$insert->bind_param("ssssi",$author,$data,$title,$description, $ImageExist);
$insert->execute();
$statement = $con->prepare("SELECT id FROM kys_write WHERE Title=?");
$statement->bind_param("s",$title);
$statement->execute();
$statement->bind_result($lastId);
//Everything works fine if this whole part is removed
$sql = "UPDATE kys_essentials SET LastId=".$lastId;
if ($con->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $con->error;
}
Ich bin eine Störung zu erhalten:
Error updating records:Commands out of sync, you cannot run this command now.
Was dies verursacht und wie kann ich es vermeiden?
Mögliches Duplikat [PHP-Befehle Out of Sync-Fehler] (http: //stackoverflow.com/questions/14554517/php-commands-out-of-sync-error) – e4c5
Mögliches Duplikat von [Nicht synchronisierte Befehle; Sie können diesen Befehl jetzt nicht ausführen] (http://stackoverflow.com/questions/614671/commands-out-of-sync-you-cant-run-this-command-now) –
Ich habe beide oben gesehen aber es hilft nicht! – Jois