Avatar of curiouswebster
curiouswebster
Flag for United States of America

asked on 

MySQL: I need to create a primary key on contact_id

I need to make contact_id a Primary key, unique and auto-incrementing. Could you provide me the script?

It seems, the phpMyAdmin panel may not have that ability to do all three. Plus, I prefer a script which I can save or later.

When I click MySQL's INSERT option, I see the wrong query created. (I did not insert a Default value, since I want that auto-generated.)

So, the INSERT option includes that contact_id field.

INSERT INTO `ps_contacts`(`contact_id`, `username`, `password`, `email`, `fname`, `lname`) VALUES ('[value-1]','[value-2]','[value-3]','[value-4]','[value-5]','[value-6]')

Please provide me the script which include that one field, contact_id, as a Primary key, unique and auto-incrementing.

Thanks
DatabasesPHPScripting LanguagesMySQL ServerWordPress

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon