Ver Mensaje Individual
  #19 (permalink)  
Antiguo 29/05/2009, 12:16
Avatar de el_cesar
el_cesar
 
Fecha de Ingreso: mayo-2001
Ubicación: Cali
Mensajes: 2.423
Antigüedad: 23 años
Puntos: 20
Respuesta: generar consecutivo

Cita:
Iniciado por abimaelrc Ver Mensaje
Hazle caso a jam1138 que debes arreglar la base de datos para que solo llames en un futuro el ultimo caso asi como tu mencionaste

$sql="SELECT * FROM comprobante_egreso ORDER BY ib_comprobante DESC LIMIT 1";

Por tu culpa el_cesar me regañaron
jajajaja, suelo causar ese efecto, mentiras ahora si en serio a que se refieren con arreglar la base de datos,
esta es la estructura que tengo
Cita:
-- Estructura de tabla para la tabla `comprobante_egreso`
--

CREATE TABLE `comprobante_egreso` (
`ib_comprobante` varchar(5) NOT NULL,
`ciudad` text NOT NULL,
`fecha` date NOT NULL,
`valor` int(11) NOT NULL,
`pagado_a` text NOT NULL,
`concepto` text NOT NULL,
`suma_letras` text NOT NULL,
`efectivo` int(11) NOT NULL,
`cheque` text NOT NULL,
`banco` text NOT NULL,
`sucursal` text NOT NULL,
`elaboro` text NOT NULL,
PRIMARY KEY (`ib_comprobante`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
y ahi me perdonas por lo del "regaño" jeje
__________________
Say no more.......