Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/04/2012, 23:03
Avatar de carlos_belisario
carlos_belisario
Colaborador
 
Fecha de Ingreso: abril-2010
Ubicación: Venezuela Maracay Aragua
Mensajes: 3.156
Antigüedad: 14 años
Puntos: 461
Respuesta: Como mostrar en php el último ID + 1

Cita:
Iniciado por neveuster Ver Mensaje
Muchas gracias GatorV


$Sql = "SELECT MAX(`id_factura`) + 1 AS proxima FROM `factura`";
$resu = mysql_query($Sql, $conexion) or die(mysql_error());

$row = mysql_fetch_array($Sql);


echo $row['proxima'];
fijate en lo que esta en rojo el mysql_fetch_array espera un resulset no un string, saludos
__________________
aprende d tus errores e incrementa tu conocimientos
it's not a bug, it's an undocumented feature By @David
php the right way