You are here: Re: Cant alter data in primary key fields « All PHP « IT news, forums, messages
Re: Cant alter data in primary key fields

Posted by Jon on 01/10/06 00:06

While you should be able to change it, it doesn't feel like good data
practice to me. I'd go back and set that table to be 2 fields personally - a
discountID, and a discount. Even if it's only one record it's a better way
to handle the data (obviously just one man's opinion and open to debate).

When you say you're trying to update it, is that just within PHP pages? Have
you tried going in and editing it manually in the DB via a command line or
admin tool at all? It should throw an error if a PHP isn't updating it
(assuming you have PHP error displaying on), so it's almost as if the query
isn't running at all.

"J.O. Aho" <user@example.net> wrote in message
news:42fj1aF1gta2bU1@individual.net...
> jj wrote:
>> Thanks for the reply.
>>
>> My problem isnt that there are duplicates. My table is as simple as it
>> possibly gets:
>>
>>
>> table name : UPS
>>
>> --------------
>> discount(PK)
>> --------------
>> 0.33
>> --------------
>>
>> It only has one value in the entire table.
>>
>> Now if I try to alter the 0.33 to any value it just reverts back to the
>> 0.33. No error is given at all either.
>
> Okey, what SQL server do you use (name and version)?
> What about does the user you logged into the SQL server has the right to
> modify it? There is the GRANT that will be needed to be issued by the SQL
> admin user to allow other users to get the priviliges to do different
> things
> with databases and tables.
>
> You can try the ALTER to modify the table so that the column no longer
> will be
> the primary key.
>
>
> For Mysql:
> http://dev.mysql.com/doc/refman/5.0/en/grant.html
> http://dev.mysql.com/doc/refman/5.0/en/alter-table.html
>
>
> //Aho

 

Navigation:

[Reply to this 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

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