Re: How to update all the column types in a table...

From: Date: Fri, 30 Nov 2001 14:41:54 +0000
Subject: Re: How to update all the column types in a table...
Groups: php.db 
Request: Send a blank email to php-db+get-14720@lists.php.net to get a copy of this message
Hi, you can run the following query from your mysql console ot from a php script update table_name set field_name=password(field_name); Be very careful because you will not be able to see the unencrypted data in your table afterwards. I recommend that you backup your table before running the UPDATE query. As long the MySQL passwords are always 16 char long you might consider altering the column type to char(16) ALTER TABLE table_name CHANGE field_name field_name CHAR (16) not null; Hope this helps Dobromir Velev Web Developer www.websitepulse.com -----Original Message----- From: Trond Erling Hundal <webmaster@port-industry.com> To: Mysql Mailinglist <php-db@lists.php.net> Date: Friday, November 30, 2001 15:57 Subject: [PHP-DB] How to update all the column types in a table... >I need to change a varchar into password(varchar) for a password column. >What is the common SQL syntax to do this. > >The table allready has all of the password's stored. I just need to encrypt >them with password($value) > >...Or will I have to just make a php script to extract and update? > > __ _ > / / (_)__ __ ____ __ > / /__/ / _ \/ // /\ \/ / . . . t h e c h o i c e o f a >/____/_/_//_/\_,_/ /_/\_\ G N U g e n e r a t i o n . . . > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net >For additional commands, e-mail: php-db-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.db (#14720) next »