Jump to content

Archived

This topic is now archived and is closed to further replies.

belick

Mixing php function in SELECT query

Recommended Posts

I need to use my PHP function in the mysql query like:

 

 

SELECT Password FROM TABLE WHERE User = 'AnyUser' && '$_POST[PASS]' = checkcrypt(Password ) LIMIT 0,1

 

Any help?

Share this post


Link to post
Share on other sites
$sql = "SELECT Password FROM TABLE WHERE User = 'AnyUser' && '$_POST[PASS]' = '".checkcrypt(Password)."' LIMIT 0,1"; 

Share this post


Link to post
Share on other sites

I tried that, the problem is that I need to place the "Password" field from the database which is something like: SDFDS3532523rfqASdfsd3D23D3f223g3g and instatd its try to decrypt the word Password...

 

 

 

Share this post


Link to post
Share on other sites

i thought Password was coming from a php variable...

how did you store the password? MD5?

Share this post


Link to post
Share on other sites

kind of I have my own encryption function, if it was md5 so mysql would work fine, that's my problem... :-(

Share this post


Link to post
Share on other sites

if you encrypt the password before storing into the db, then you could use the syntax I gave you. If not, then you have to do that after you got the record from the query.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.