-1
Good morning, I need to delete a record and 2. Ex. I want to delete the record with ID 1 and the next 2 (2 and 3), how do I do this?
I have only Cod to exclude the main (1)
$stmt = $PDO->prepare("DELETE FROM banco WHERE id = :id");
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
if ($stmt->execute()):
header("Location: home.php");
else:
echo "Erro ao remover";
print_r($stmt->errorInfo());
endif;
I don’t know how to do it... thank you
id = :id
, change this condition in the query.– Woss
using a while?
– Betinho Silva
id IN (1, 2, 3)
– Woss
but when the main one is ex. id 232 to get the id’s 233 and 234
– Betinho Silva
Ué, only generate values with PHP and leave dynamic...
– Woss
that’s the question... how to do?
– Betinho Silva
$id+1
,$id+2
and so on...– Woss
I will test and return you
– Betinho Silva