Jump to content

Recommended Posts

I tried the following alter query but phpmyadmin still shows "No" under the Null column.

 

ALTER table model_in_city Modify city_id int unsigned null;

 

Also tried changing it in phpmyadmin and picked "null" from the dropdown menu but it's still displaying as not null. Any ideas?

 

Link to comment
https://forums.phpfreaks.com/topic/237497-changing-a-not-null-table-to-null/
Share on other sites

How can I remove the primary key for city_id?

 

I tried to remove it in phpmyadmin but got this error:

 

Error

SQL query:

 

ALTER TABLE  `model_in_city` DROP PRIMARY KEY ,

ADD PRIMARY KEY (  `model_id` )

 

MySQL said:

 

#1062 - Duplicate entry '17' for key 1

if the table can have more than one row with the same model_id, then model_id can not be the primary key by itself. The primary key, whether it be one column or more, has to be able to be used to uniquely identify any one row in the table.

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.