Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/08/2012, 08:15
beeman00
 
Fecha de Ingreso: enero-2012
Ubicación: Caracas
Mensajes: 75
Antigüedad: 12 años, 3 meses
Puntos: 21
Respuesta: Problema con Autoincrement al usar ON DUPLICATE KEY UPDATE

Intenta esto....

Código MySQL:
Ver original
  1. mysql_query("INSERT INTO visitas (IP, cantidad) VALUES ('".$_SERVER['REMOTE_ADDR']."','1') ON DUPLICATE KEY UPDATE cantidad=cantidad+1, id=LAST_INSERT_ID(id)");

Última edición por beeman00; 16/08/2012 a las 08:17 Razón: correccion....