Re: function use in sql -- md5
| From: | Philip Olson | Date: | Wed, 15 Nov 2000 04:26:50 +0000 |
| Subject: | Re: function use in sql -- md5 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25350@lists.php.net to get a copy of this message | ||
Hey David-
I try to test this and :
mysql> UPDATE toc SET description = MD5(description);
ERROR 1064: You have an error in your SQL syntax near '(description)' at
line 1
mysql>
in this case :
table = toc
column = description
Thoughts? It _seems_ this is correct logic (btw, i meant update table
before) but strangly it does not do as expected. Does mysql command line
allow for md5? I thought it does but now am not sure as I see it in
docs yet ... so i will use php right now ...
Philip
--
be outside the box.
On Wed, 15 Nov 2000, David Robley wrote:
> 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
>