0
Can anyone explain to me what the error or if there is a flaw in the script??
As far as I know this is correct, but it doesn’t work.
In the script it takes the ID of who followed and the ID of who was followed and should remove by the parameters WHERE
of the line MYSQL, but it’s not deleting..
// SISTEMA DE FOLLOW::USERS
if(isset($_POST['action']) && $_POST['action'] == 'func_follow') {
$method = $_POST['method'];
$id_de = $_POST['id_de'];
$id_para = $_POST['id_para'];
$f_data = time();
if($method == 'remove'){
$busca_dados_s = $pdo->prepare("SELECT * FROM `lc_follow` WHERE `f_de` = ? AND `f_para` = ?");
$busca_dados_s->execute(array($id_de, $id_para));
if($busca_dados_s->rowCount() > 0){
$lc_unfollow_dados = $pdo->prepare("DELETE FROM `lc_follow` WHERE `f_de`=:f_de AND `f_para`=:f_para)");
$lc_unfollow_dados->bindValue(":f_de",$id_de);
$lc_unfollow_dados->bindValue(":f_para",$id_para);
$lc_unfollow_dados->execute();
if($lc_unfollow_dados){
echo '<div class="but_add" onclick="functionAjax_follow(\''.$id_de.'\', \''.$id_para.'\',\'add\')">
Seguir
</div>';
} else {
echo '::ERRO::';
}
}
}
}
Is the same issue?
– rray