Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/02/2008, 10:30
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 20 años, 4 meses
Puntos: 2135
Re: Actualizar Autoincrement PHP+SQL

Es mejor limpiar la variable para evitar errores de SQL Inyection o similares:
Código PHP:
$valor = (int) $_POST['desde'];
$alterar = "ALTER TABLE table_name AUTO_INCREMENT = $valor";
$result = mysql_query( $alterar, $conectar ) or die( mysql_error() ); 
Saludos.