query('select customers_id from :table_customers where customers_email_address = :customers_email_address limit 1'); $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS); $Qcheck->bindValue(':customers_email_address', $email_address); $Qcheck->execute(); if ($Qcheck->numberOfRows() === 1) { return true; } return false; } function checkPassword($email_address, $password) { global $osC_Database; $Qcheck = $osC_Database->query('select customers_password from :table_customers where customers_email_address = :customers_email_address limit 1'); $Qcheck->bindTable(':table_customers', TABLE_CUSTOMERS); $Qcheck->bindValue(':customers_email_address', $email_address); $Qcheck->execute(); if ($Qcheck->numberOfRows() === 1) { if ( (strlen($password) > 0) && (strlen($Qcheck->value('customers_password')) > 0) ) { $stack = explode(':', $Qcheck->value('customers_password')); if (sizeof($stack) === 2) { if (md5($stack[1] . $password) == $stack[0]) { return true; } } } } return false; } function getID($email_address) { global $osC_Database; $Quser = $osC_Database->query('select customers_id from :table_customers where customers_email_address = :customers_email_address limit 1'); $Quser->bindTable(':table_customers', TABLE_CUSTOMERS); $Quser->bindValue(':customers_email_address', $email_address); $Quser->execute(); if ($Quser->numberOfRows() === 1) { return $Quser->valueInt('customers_id'); } return false; } } ?>