MySQL Problem...

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
Hi,,


I have used auto increment property for my primary key in a table...
but in case when i delete old records,and then when i addd new records then ,the value starts from the value that was previously stored...

i mean ..if i have stored upto 3 then when i delete all the records new record starts from 1..i want to start it from 4(only when i delete all records )...

One more thing...
Query :
$sql = 'CREATE TABLE Donor(DID VARCHAR2(10) NOT NULL PRIMARY KEY,pass TEXT,bg TEXT,name TEXT,gender TEXT,dob DATE,phone INT,email TEXT,address TEXT,city TEXT,dis TEXT,dor DATE,soa TEXT)';

Error:
BLOB/TEXT column 'DID' used in key specification without a key length

I want to keep the did field as an alphanumeric type..kindy provide some solution..

thanks
 
Last edited:

MasterMax1313

New Member
Messages
84
Reaction score
0
Points
0
as for your autoincrement issue. that's not really an issue. that's just how MySQL (and if i'm not mistaken, MSSQL) works. Unless you truncate the table, it will do that. I think there's ways to get MySQL to reuse ones that have been deleted, but i'm not sure.

as for the other issue, i'm not sure. anyone else?
 

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
I JUST CHANGED THE datatype to varchar..found the solution on the net
and am using user generated ID now..

thanks neway for replying
 
Top