delete * da tabela não funciona [fechado]
Estou tentando excluirtodas as linhas da tabela, mas não está funcionando. quando eu façoecho $mydb->error;
dá-me o seguinte:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM messages where from_user = ? and id = ?'
$user = 'currentuser';
if (isset($_POST['delete'])) {
if(!empty($_POST['id'])){
$id = $_POST['id'];
$mydb = new mysqli('localhost', 'root', '', 'database');
$stmt = $mydb->prepare("DELETE * FROM messages where from_user = ? and id = ? ");
echo $mydb->error;
$stmt->bind_param('ss', $user, $id);
foreach ($_POST['id'] as $id) {
$stmt->execute();
}
echo"The Message deleted permanently";
}
}