Re: [OT] [PHP-ES] Ultimo registro ingresado
| From: | Rob. | Date: | Wed, 13 Nov 2002 17:35:44 +0000 |
| Subject: | Re: [OT] [PHP-ES] Ultimo registro ingresado | ||
| References: | 1 2 3 4 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-29197@lists.php.net to get a copy of this message | ||
Llevo usando Mysql cerca de un año y efectivamente los campos autoincrement permiten hacer updates con amplia libertad. Teniendo el contador en 1532 me permitió insertar el registro 2000.
Pero ninguna de estas operaciones porvocó un mal funcionamiento ni un ID desmesurado.
Tendrá que ver con la versión de Mysql? yo uso la 3.23.41
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":-- Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/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" --------------------------------------------------------------------- Archivo On-line: http://www.phpes.com/ via news: news://news.phpes.com/ Manual PHP en español: http://www.php.net/manual/es/ Para dar de baja la suscripción, mande un mensaje a: lista-unsubscribe@phpes.com