Jump to content

Initial Values With Int's


jfs0479

Recommended Posts

Hi Guys,

I am currently working on a project that requires members to have auto_assigned ID with charcters infront of them like ARB1 or ARB589 . Below i have the sql query i have currently but i would like it so that i could have it in the explained fromat not just 1 or 446

 

create table arab_members (
memberid int(5) unsigned NOT NULL auto_increment,
forename varchar (255),
surname varchar(255),
country varchar(255),
email varchar(255),
reason text,
age int,
sex varchar(100),
hub varchar(255),
previousva varchar(255),
password varchar(255),
level int,
rank varchar(255),
activate text,
registerdate text,
lastactive text,
ip int,
PRIMARY KEY (memberid)
);

 

Thanks

 

James

Link to comment
https://forums.phpfreaks.com/topic/46575-initial-values-with-ints/
Share on other sites

You will have to turn auto_increment off on that column

 

and change the data type for that column to VARCHAR, as you are now dealing with a string and not an integer

 

integers cannot have letters/symbols only numbers. 0 through to 9

 

If keep it as INT mysql will strip any non numerical character out and only store the numbers.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.