belick Posted November 21, 2005 Share Posted November 21, 2005 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? Link to comment https://forums.phpfreaks.com/topic/2910-mixing-php-function-in-select-query/ Share on other sites More sharing options...
ryanlwh Posted November 21, 2005 Share Posted November 21, 2005 $sql = "SELECT Password FROM TABLE WHERE User = 'AnyUser' && '$_POST[PASS]' = '".checkcrypt(Password)."' LIMIT 0,1"; Link to comment https://forums.phpfreaks.com/topic/2910-mixing-php-function-in-select-query/#findComment-9763 Share on other sites More sharing options...
belick Posted November 21, 2005 Author Share Posted November 21, 2005 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... Link to comment https://forums.phpfreaks.com/topic/2910-mixing-php-function-in-select-query/#findComment-9764 Share on other sites More sharing options...
ryanlwh Posted November 21, 2005 Share Posted November 21, 2005 i thought Password was coming from a php variable... how did you store the password? MD5? Link to comment https://forums.phpfreaks.com/topic/2910-mixing-php-function-in-select-query/#findComment-9765 Share on other sites More sharing options...
belick Posted November 21, 2005 Author Share Posted November 21, 2005 kind of I have my own encryption function, if it was md5 so mysql would work fine, that's my problem... :-( Link to comment https://forums.phpfreaks.com/topic/2910-mixing-php-function-in-select-query/#findComment-9766 Share on other sites More sharing options...
ryanlwh Posted November 21, 2005 Share Posted November 21, 2005 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. Link to comment https://forums.phpfreaks.com/topic/2910-mixing-php-function-in-select-query/#findComment-9767 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.