0
I have the following code where I am trying to delete a column from the comic through php :
session_start();
$dbh = new PDO('mysql:host=localhost;dbname=samsic', 'root', '');
$sql = $dbh->prepare("DELETE FROM ferias WHERE id=':i' and idtrabalhador=':it' ");
$sql->bindValue(':i',$_GET['id']);
$sql->bindValue(':it',$_SESSION['id']);
$resultado=$sql->execute();
if($resultado){
echo "Apagou";
}else{
echo "não apagou";
}
The code always returns to me "Deleted" but it doesn’t erase anything in the database. On the other hand, if you copy the sql statement I have in php in mysql and replace it with the same values it will work correctly and delete the column.
Someone can help me?
I removed the values to be received from the query and it worked
– Marco Silva