troubleshooting Question

MySQL: I need to create a primary key on contact_id

Avatar of curiouswebster
curiouswebsterFlag for United States of America asked on
DatabasesPHPMySQL ServerScripting LanguagesWordPress
2 Comments1 Solution14 ViewsLast Modified:
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
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros