Dear fellows

I've entrapped myself, trying to simplify my life.
I've just changed from pure DBI access libraries to Class::DBI and I'm currently rewriting code to authenticate and change his/her password using this module.

I'm encripting database stored passwords using MySQL's PASSWORD() SQL Function.

What I need is a simple way to make Class::DBI do what the SQL code below does:

  1. Fetch user data from database:
    SELECT [columns] FROM user WHERE id='$id' AND passwd=PASSWORD('$pwd')
  2. Update user password in database:
    UPDATE user SET passwd=PASSWORD('$pwd') WHERE id='$id'

I can't figure out from docs how do I call MySQL's PASSWORD() function from the Class::DBI module.

Any help would be nice.
Thank you very much.


"In few words, translating PerlMonks documentation and best articles to other languages is like building a bridge to join other Perl communities into PerlMonks family. This makes the family bigger, the knowledge greather, the parties better and the life easier." -- monsieur_champs


In reply to How to call MySQL's PASSWORD() from Class::DBI? by monsieur_champs

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.