Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/10/2010, 12:49
Avatar de Heiroon
Heiroon
 
Fecha de Ingreso: junio-2010
Ubicación: Caracas, Venezuela - Por ahora...
Mensajes: 495
Antigüedad: 13 años, 11 meses
Puntos: 63
problema con mysql_affected_rows()

buenas amigos... que tal?

estoy utilizando la funcion mysql_affected_rows() y por alguna razon no esta funcionando.. dejo el script a ver si el problema esta en otro lado.. Gracias anticipadas!!!


Código PHP:
Ver original
  1. if($_GET['rating'] && $_GET['Iduser']){
  2.    
  3.         $Iduser = $_GET['Iduser'];
  4.         $local = $_GET['local'];
  5.         $rating = $_GET['rating'];
  6.  
  7.         if(is_numeric($rating)){
  8.            
  9.             $update = "UPDATE g_voto_local set valor_voto = '".$rating."'  WHERE id_user = '".$Iduser."' AND id_local = '".$local."'";
  10.             //echo "UPDATE g_voto_local set valor_voto = '".$rating."'  WHERE id_user = '".$Iduser."' AND id_local = '".$local."'";
  11.             $result = mysql_query($update);
  12.  
  13.                 if(mysql_affected_rows() == 0){
  14.                
  15.                 $insert = "insert into g_voto_local (id_local,id_user,valor_voto) values ('".$local."','".$Iduser."','".$rating."')";
  16.                 $result = mysql_query($insert);
  17.                
  18.                 }
  19.         }