php - Decryption: Using a loop to go through a function using mysql -
i'm trying make code displays user's passwords transfer new website. have right now.
function decryptpassword($users) { global $sql_tbl; $userdata=func_query_first("select * $sql_tbl[customers] login='".$users."'"); if ($userdata["password"]!="") $password = text_decrypt($userdata["password"]); else return false; return $password; } echo "master = ".decryptpassword('master')."<br>"; $a = decryptpassword('tester'); if ($a===false) { echo "user not found...";exit();} echo "tester = ".decryptpassword('tester')."<br>"; ?>
and works, wanted use each query , have been having trouble trying a loop. should doing differently?
function decryptpassword($users) { global $sql_tbl; $userdata=func_query_first("select * $sql_tbl[customers] login='".$users."'"); if ($userdata["password"]!="") $password = text_decrypt($userdata["password"]); else return false; return $password; } $email=msql_query("select email $sql_tbl[address_book] join xcart_customers on xcart_prod.xcart_address_book.userid=xcart_prod.xcart_customers.id (default_s = 'y' , default_b='y'and membershipid=2) or (default_s='n' , default_b='y' , membershipid=2)"); while ($row = mysql_fetch_assoc($email)) { foreach($row $field) { echo " = ".decryptpassword($field)."<br>"; $a = decryptpassword($field); if ($a===false) { echo "user not found...";exit();} echo "it@claramente.com = ".decryptpassword($field)."<br>"; } }
thanks help.
Comments
Post a Comment