Ik gebruik het volgende programa om een tabel te verwijderen. Ik krijg onderstaande error melding deze kan ik niet plaatsen
Connected successfully.
Could not drop database: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.klant' at line 1
Connected successfully.
Could not drop database: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '.klant' at line 1
Code:
<html>
<head><title>Dropping MySQL Database</title></head>
<body>
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$mysqli = new mysqli($dbhost, $dbuser, $dbpass);
if($mysqli->connect_errno ) {
printf("Connect failed: %s<br />", $mysqli->connect_error);
exit();
}
printf('Connected successfully.<br />');
if ($mysqli->query("Drop DATABASE sailsup.klant")) {
printf("Database klant dropped successfully.<br />");
}
if ($mysqli->errno) {
printf("Could not drop database: %s<br />", $mysqli->error);
}
$mysqli->close();
?>
</body>
</html>
Laatst bewerkt door een moderator: