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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.