[OT] [PHP-ES] Ultimo registro ingresado
| From: | Dr Zippie | Date: | Wed, 13 Nov 2002 12:42:24 +0000 |
| Subject: | [OT] [PHP-ES] Ultimo registro ingresado | ||
| References: | 1 2 3 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-29167@lists.php.net to get a copy of this message | ||
Es un bug cuando tienes mil registros ... borras el id num 999 y pasas el id 1000 al 999 (update) y
a partir de ahí todo se descontrola (el siguiente insert genera un ID desmesurado) ... no habiendo
concurrencia ni nada parecido. Vamos que no he hecho nada del otro mundo ... ya me dirás si esto no
es un bug ;-)
_.-. _.-. _.-. _.-. EN RESPUESTA A _.-. _.-. _.-. _.-. _.-.
Andres Ferrando comentaba el [13/11/02-9:35] sobre " Re: [PHP-ES] Ultimo registro
ingresado":
>No es un bug.
>Simplemente, tenés que elegir bien el tipo de datos para ese campo.
>Probablemente, int o bigint, y unsigned.
>Si te pasás, lo redondea al mayor posible, y te da error de clave
>repetida:
>For example, the range of an INT column is -2147483648 to 2147483647. If
>you try to insert -9999999999 into an INT column, the value is clipped
>to the lower endpoint of the range, and -2147483648 is stored instead.
>Similarly, if you try to insert 9999999999, 2147483647 is stored instead.
>
>si la memoria no me falla, existe una forma de "reiniciar" ese contador ...
Dr Zippie (zippie(a)dr-zippie.net)
www.dr-zippie.net ** en construcción **
"El ordenador es la evolucion logica del hombre: Inteligencia sin moral": John Osborne.
"A nullo videbatur, ipse autem omnia videbat"