php-general Digest 26 Jun 2013 17:07:21 -0000 Issue 8279

2013-06-26 Thread php-general-digest-help
php-general Digest 26 Jun 2013 17:07:21 - Issue 8279 Topics (messages 321493 through 321495): Problem with variables 321493 by: Fernando A 321494 by: Jim Giner Reseting the auto-increment number in a MySQL database. 321495 by: Tedd Sperling Administrivia: To

[PHP] Reseting the auto-increment number in a MySQL database.

2013-06-26 Thread Tedd Sperling
Hi gang: I have a client where their next auto-increment number just jumped from 2300 to 10 for reasons not understood. They want it set back. Options such as dropping the primary key and rebuilding the index is NOT possible -- this is a relational table thing. So, is there a way

Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-26 Thread Samuel Lopes Grigolato
You can try this: *ALTER TABLE tbl AUTO_INCREMENT = 100;* * * *Source: *http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html (never did it myself, though) On Wed, Jun 26, 2013 at 2:07 PM, Tedd Sperling t...@sperling.com wrote: Hi gang: I have a client where their next

Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-26 Thread Stuart Dallas
On Wednesday, 26 June 2013 at 18:07, Tedd Sperling wrote: Hi gang: I have a client where their next auto-increment number just jumped from 2300 to 10 for reasons not understood. They want it set back. Options such as dropping the primary key and rebuilding the index is NOT

Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-26 Thread Tedd Sperling
On Jun 26, 2013, at 1:13 PM, Stuart Dallas stu...@3ft9.com wrote: On Wednesday, 26 June 2013 at 18:07, Tedd Sperling wrote: Hi gang: I have a client where their next auto-increment number just jumped from 2300 to 10 for reasons not understood. They want it set back. Options such

Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-26 Thread Jim Giner
On 6/26/2013 1:30 PM, Tedd Sperling wrote: On Jun 26, 2013, at 1:13 PM, Stuart Dallas stu...@3ft9.com wrote: On Wednesday, 26 June 2013 at 18:07, Tedd Sperling wrote: Hi gang: I have a client where their next auto-increment number just jumped from 2300 to 10 for reasons not

[PHP] Last Record INSERT

2013-06-26 Thread Tedd Sperling
Hi gang: What's the most-current way to get the ID of the last recorded inserted in a database? Cheers, tedd _ t...@sperling.com http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-26 Thread Tedd Sperling
On Jun 26, 2013, at 1:32 PM, Jim Giner jim.gi...@albanyhandball.com wrote: But more importantly - don't you need to figure out why it happened?? As well as correcting any inserts with the bogus id? Yes, I would like to know -- I'm open for suggestions. Cheers, tedd _

Re: [PHP] Last Record INSERT

2013-06-26 Thread Tedd Sperling
Gang: Let me add, currently I am inserting an email address into a database. To find which record was created, I ask for the record number (ID) back. I am asking simply because mysql_insert_id() is deprecated. Cheers, tedd _ tedd.sperl...@gmail.com http://sperling.com

Re: [PHP] Last Record INSERT

2013-06-26 Thread Stuart Dallas
On Wednesday, 26 June 2013 at 18:39, Tedd Sperling wrote: Let me add, currently I am inserting an email address into a database. To find which record was created, I ask for the record number (ID) back. I am asking simply because mysql_insert_id() is deprecated. How are you doing the

Re: [PHP] Last Record INSERT

2013-06-26 Thread Tedd Sperling
On Jun 26, 2013, at 1:56 PM, Stuart Dallas stu...@3ft9.com wrote: On Wednesday, 26 June 2013 at 18:39, Tedd Sperling wrote: Let me add, currently I am inserting an email address into a database. To find which record was created, I ask for the record number (ID) back. I am asking simply

Re: [PHP] Last Record INSERT

2013-06-26 Thread Stuart Dallas
On Wednesday, 26 June 2013 at 19:01, Tedd Sperling wrote: On Jun 26, 2013, at 1:56 PM, Stuart Dallas stu...@3ft9.com (mailto:stu...@3ft9.com) wrote: On Wednesday, 26 June 2013 at 18:39, Tedd Sperling wrote: Let me add, currently I am inserting an email address into a database. To

Re: [PHP] Last Record INSERT

2013-06-26 Thread Samuel Lopes Grigolato
AFAIK mysql_[...] is deprecated in favor of mysqli_[...] correspondent functions, there's nothing to do specifically with mysql[i]_insert_id. On Wed, Jun 26, 2013 at 3:01 PM, Tedd Sperling tedd.sperl...@gmail.comwrote: On Jun 26, 2013, at 1:56 PM, Stuart Dallas stu...@3ft9.com wrote: On

Re: [PHP] Last Record INSERT

2013-06-26 Thread Dan Munro
Learning something new everyday is one of the joys of this profession. If you learn two new things, consider yourself lucky :) On Wed, Jun 26, 2013 at 11:03 AM, Samuel Lopes Grigolato samuel.grigol...@gmail.com wrote: AFAIK mysql_[...] is deprecated in favor of mysqli_[...] correspondent

Re: [PHP] Last Record INSERT

2013-06-26 Thread Carsten Jensen
On 06/26/2013 08:03 PM, Samuel Lopes Grigolato wrote: AFAIK mysql_[...] is deprecated in favor of mysqli_[...] correspondent functions, there's nothing to do specifically with mysql[i]_insert_id. On Wed, Jun 26, 2013 at 3:01 PM, Tedd Sperling tedd.sperl...@gmail.comwrote: On Jun 26,

Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-26 Thread Matijn Woudt
On Wed, Jun 26, 2013 at 7:35 PM, Tedd Sperling tedd.sperl...@gmail.comwrote: On Jun 26, 2013, at 1:32 PM, Jim Giner jim.gi...@albanyhandball.com wrote: But more importantly - don't you need to figure out why it happened?? As well as correcting any inserts with the bogus id? Yes, I would

Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-26 Thread Jim Lucas
On 06/26/2013 10:07 AM, Tedd Sperling wrote: Hi gang: I have a client where their next auto-increment number just jumped from 2300 to 10 for reasons not understood. They want it set back. Options such as dropping the primary key and rebuilding the index is NOT possible -- this is a

Re: [PHP] Last Record INSERT

2013-06-26 Thread Tedd Sperling
On Jun 26, 2013, at 2:10 PM, Dan Munro d...@danmunro.com wrote: Learning something new everyday is one of the joys of this profession. If you learn two new things, consider yourself lucky :) What if it's the same two things? New just means I didn't remember it. Cheers, tedd

Re: [PHP] Reseting the auto-increment number in a MySQL database.

2013-06-26 Thread Tedd Sperling
On Jun 26, 2013, at 3:23 PM, Matijn Woudt tijn...@gmail.com wrote: What storage engine are you using? InnoDB is known for it's auto increment holes, but I didn't expect the holes to be that big. I have no idea. It's not my database. It's Constant Contact's -- I just put stuff in it as per

Re: [PHP] Last Record INSERT

2013-06-26 Thread Curtis Maurand
Look up using the mysqli libraries. This was about a 30 second php.net search. http://us3.php.net/manual/en/mysqli.insert-id.php Cheers, Curtis On 6/26/2013 1:33 PM, Tedd Sperling wrote: Hi gang: What's the most-current way to get the ID of the last recorded inserted in a database?