Reply to Re: Change field to Not Null in MySQL

Your name:

Reply:


Posted by Jerry Stuckle on 11/22/05 16:19

Smitro wrote:
> Jerry Stuckle wrote:
>
>> Smitro wrote:
>>
>>> Hi all,
>>>
>>> I'm in the middle of building a new server up and converting current
>>> web sites across. in this process I have moved to PHP 5 and MySQL 5.
>>> I have just run into a problem with MySQL.
>>>
>>> I'm using phpMyAdmin to do the editing of tables. I cannot set a
>>> feild to be Not Null. When I do, it runs the command without error
>>> but doesn't change anything. I've tried with auto increment and
>>> without. I'm just doing the simple way, editing the table then
>>> changeing the drop down box, and it will not change.
>>>
>>> I thought maybe there was something wrong with my table, so I created
>>> a test one, and the same thing happened. Any ideas? I'm scraching my
>>> head, I've done this in the past without a problem.
>>>
>>> Smitro
>>
>>
>>
>> Smitro,
>>
>> Do you in fact have nulls in the column on any row?
>>
>> Null/Not Null is only a constraint on the column; changing it doesn't
>> actually change the contents of that column. If you want to change to
>> not null, you must first get rid of all null values in the column
>> (i.e. UPDATE statement), then change the constraint.
>>
>
> I have tried it on a new table with no data and same problem.

Hmmm, I can do it, but I'm still running PHP 4.

What happens if you do it from a MySQL command line? Does it work there?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация