Re: function use in sql -- md5
| From: | Philip Olson | Date: | Wed, 15 Nov 2000 04:34:22 +0000 |
| Subject: | Re: function use in sql -- md5 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25358@lists.php.net to get a copy of this message | ||
Hey Jeremy!
> Don't forget your WHERE clause, otherwise you will update your whole
> table with that one value.
I want to affect every rows value with MD5 so figured this would do the
job. I mistyped example it should have been :
update mytable
set mycolumn = md5(mycolumn);
But this gives me error, perhaps my mysql does noth ave md5 compiled? idk.
> But, I've never used the MD5() mysql function, I don't know if that
> part will work.
I tried, failed. David confirmed belief that this should work but idk wht
to say now as I cannot get it to do my bidding.
> I always tend to write little php scripts to handle the job. That
> way, I can minimize the CPU required on my single DB server and try
> and keep all the CPU intensive stuff on my workstation.
This is a one time deal, run a function (md5) against a column (plaintext)
and besides it is a tiny db and figured one command line vs. going through
php would be ideal for such an occasion. Your thoughts on the matter make
perfect sense.
Thanks!
Philip
> :)
> -jeremy
>
> http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for
> more
> ---------------------------------------------------------------------
> We cannot do everything at once, but we can do something at once.
> -- Calvin Coolidge
>
> On Wed, 15 Nov 2000, Philip Olson wrote:
>
> > Date: Wed, 15 Nov 2000 02:35:57 +0000 (GMT)
> > From: Philip Olson <philip@theprojects.org>
> > To: php-general@lists.php.net
> > Subject: [PHP] function use in sql -- md5
> >
> > 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
> >
> >
> >
> >
> > --
> > be outside the box.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>