Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-01-2007, 05:36 PM   #1
biskoppen
Confirmed User
 
Join Date: Mar 2003
Location: Very small penis
Posts: 5,809
MySQL question

Let's say I have a table with an auto_increment field called "id"..

This table got 5 rows.. where "id" goes from 1-5..

Now I delete row 4 and 5..

The next row I insert will get "id" = 6...

How do I get it do let the next "id" to start at 4 which is the highest available number?

(Don't ask why I need that )
__________________
Submit my videos to make bank, tons of 5 minute videos offered right here
biskoppen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2007, 05:38 PM   #2
budz
Disruptive Innovator
 
budz's Avatar
 
Industry Role:
Join Date: Sep 2003
Location: Vegas
Posts: 4,230
I use navicat.. you can edit anything in your table manually.

but I'd like to know how to automate this because that is annoying when you delete records
__________________
C:\Code\
C:\Code\Run\
budz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2007, 05:51 PM   #3
Donkey Punch
Confirmed User
 
Join Date: Jun 2007
Location: :: PUNCH ::
Posts: 1,260
Quote:
INNODB tables store the auto increment id in the MYI file. Even if you delete rows and restart the server MySQL will not reuse the id. The same is true for innodb.
from gooooogle serps
__________________
ICQ:407-837-607
Hosting a Problem? Phat Servers = Answer
Donkey Punch is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2007, 05:55 PM   #4
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,231
i think 'OPTIMIZE' does that. google it, im not positive
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2007, 05:57 PM   #5
biskoppen
Confirmed User
 
Join Date: Mar 2003
Location: Very small penis
Posts: 5,809
Quote:
Originally Posted by k0nr4d View Post
i think 'OPTIMIZE' does that. google it, im not positive
Hmm... actually think I heard about that some years ago... will investigate that
__________________
Submit my videos to make bank, tons of 5 minute videos offered right here
biskoppen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2007, 06:03 PM   #6
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
why even use the auto increment feature then? just use your own id #'s
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2007, 06:15 PM   #7
biskoppen
Confirmed User
 
Join Date: Mar 2003
Location: Very small penis
Posts: 5,809
Quote:
Originally Posted by Alky View Post
why even use the auto increment feature then? just use your own id #'s
Yeah, that was mine conclusion too... changing it right now.. (Thanks though)
__________________
Submit my videos to make bank, tons of 5 minute videos offered right here
biskoppen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.