Re: function use in sql -- md5
| From: | David Robley | Date: | Wed, 15 Nov 2000 03:56:26 +0000 |
| Subject: | Re: function use in sql -- md5 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25343@lists.php.net to get a copy of this message | ||
On Wed, 15 Nov 2000, Philip Olson wrote:
> Hi friends!
>
> I have a mysql column full of plain text passwords that I'd like to hash
> via MD5. I can think of looping through and updating through php but am
> hoping to learn a little trick to speed up similar activities in the
> future. All thoughts and tips welcome for updating, ideally at the shell
> level, which is one of my current weaknesses. This will not work but is
> the idea (after setting (32) :
>
> update mycolumn
> set mycolumn = md5(mycolumn);
>
> What would be proper syntax to complete this goal? How would YOU approach
> this?
>
>
> TIA,
>
> Philip
UPDATE mytable SET mycolumn = MD5(mycolumn)
should do the trick to update _every_ row in the table, or add a WHERE
clause to limit to certain rows.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA