Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/01/2013, 01:58
innerjoin
 
Fecha de Ingreso: diciembre-2012
Mensajes: 6
Antigüedad: 11 años, 4 meses
Puntos: 0
Fade out, borra todo, pero ejecuta bien en la BD

¡Muy buenas!

Tengo un sistema de comentarios con AJAX y efecto Fade out, borra el comentario correctamente en la base de datos, pero al hacer el efecto fade out en vez de borrar un único comentario los borra todos, ¿cómo puedo focalizar el borrado al comentario seleccionado? GRACIAS.


//deleteComment
$('a.c_delete').livequery("click", function(e){

if(confirm('Are you sure you want to delete this comment?')==false)

return false;

e.preventDefault();
var parent = $('a.c_delete').parent();
var c_id = $(this).attr('id').replace('CID-','');

$.ajax({

type: 'get',

url: 'delete_comment.php?c_id='+c_id,

data: '',

beforeSend: function(){

},

success: function() {

parent.fadeOut(1000, function() {


parent.remove();

});

}

});
});

----------------------------------------------------------------------------------------------

<?php
include('dbcon.php');

echo "delete from facebook_posts_comments where c_id =' ".$_REQUEST['c_id']. "'";
mysql_query("delete from facebook_posts_comments where c_id ='".$_REQUEST['c_id']."'");

?>