473,289 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

Problem in auto_increment

Hello,

My database table containing a column name P_ID

Field Extra = P_ID,
Type = int(11),
Null = NO,
Key = PRI,
Default = NULL,
Extra = auto_increment

1. If I delete any row from my table (eg. P_ID = 2) I dont get that P_ID even I insert any new data. Is it for auto_increment?

2. If I want to remove auto_increment from that attribute, how it possible?

Advance thanks.
Feb 6 '08 #1
1 1303
mwasif
802 Expert 512MB
1. Whenever you insert a new record, you get an incremented value. This is how auto_increment works.

2. Use the following query to remove auto_increment
Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE table_name CHANGE P_ID P_ID INT( 11 ) NOT NULL
Feb 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Andrew | last post by:
I have a problem creating mySQL tables with PHP. I am making an app where a user can create a project. Pressing "submit" on proj_form.php goes to proj_add.php where a couple of things happen. ...
5
by: Paul Lamonby | last post by:
Hi, i want to create a unique serial number to my Db entries. I thought the best way would be to add the auto_increment primary key value to a string, then insert it into a table field...
2
by: Ittay Freiman | last post by:
i cannot set auto_increment to start from anything other than 1: mysql> create table test (id int unsigned not null auto_increment primary key); mysql> alter table test auto_increment=2; ...
9
by: Bart Van der Donck | last post by:
Hello, The first column of my table is AUTO_INCREMENT. I fill my table with 5 records with a blanco value in their first field. The first column of my table will then hold the values 1,2,3,4,5...
0
by: Shailesh | last post by:
I made a MyISAM table on mysql 4.0.18 NT with auto_increment column started at 2147483646. The third row I insert fails as expected because the integer range is maxed out. However, if I delete...
10
by: Sjoerd | last post by:
Hi, I have a problem with mysql joins, which are always a bit complicated to me. I use mysql version 4.0.25-standard. This is my SQLstatement, used to check if user #1 has the right to...
8
by: Daz | last post by:
Hi everyone. I was faced with the choice of whether my problem is indeed a PHP problem or a MySQL. I have decided it's a PHP problem as I don't experience the same problem when I execute the...
1
by: webandwe | last post by:
Hi The code below I took from a postgre file and convert it with a program to a mysql. Once i tried to import it to mysql it gave me an error and when i past in a php file to upload it trough a...
1
by: chromis | last post by:
Hi, I'm trying to import a mysqldump of all the databases from one server to another. First I attempted to use phpMyAdmin, I exported using the export to file option (drop database and drop tables...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.