Following is my Web host phpMyAdmin detail:
MySQL Server: Localhost via UNIX socket
Server version: 5.0.92-community
Protocol version: 10
User: smarttis@localhost
MySQL charset: UTF-8 Unicode (utf8)
Web server
cpsrvd 11.28.87
MySQL client version: 4.1.22
PHP extension: mysql
phpMyAdmin
Version information: 3.3.9.2
Following is my part of my registration code:
if($fn && $ln && $em && $city && $cty && $ph && $abda && $abmo && $abye && $p && $tq && $ta)
{
$q = "SELECT email FROM register WHERE email='$em'";
$r = mysqli_query($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: ".mysqli_error($dbc));
if(mysqli_num_rows($r) == 0)
{
$a = md5(uniqid(rand(), true));
$pass=md5('$p');
$q = "INSERT INTO register(first_name, last_name, middle_name, address, email, phone, sex, city, country, active, dob_day, dob_month, dob_year, pass, question, answer, date_registered) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,NOW())";
$stmt = mysqli_prepare($dbc, $q);
mysqli_stmt_bind_param($stmt, 'ssssssssssisisss', $fn, $ln, $mn, $ad, $em, $ph, $sex, $city, $cty, $a, $abda, $abmo, $abye, $pass, $tq, $ta);
mysqli_stmt_execute($stmt);
if(mysqli_stmt_affected_rows($stmt)==1)
{
Following is my part of my login code
if($e && $p)
{
$q = "SELECT user_id, first_name, user_level FROM register WHERE (email = '$e' AND pass=md5('$p')) AND active IS NULL";
$r = mysqli_query($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error:".mysqli_error($dbc));
if(@mysqli_num_rows($r) == 1)
{
Note: I used SHA1() for encryption before changing to MD5() as the problem persisted