I am trying to get my email verification to work. Everything works as far as sending out the email with the hash link to confirm, but once it goes to the verify.php link below it does not update my DB active row from 0 to 1. Any suggestions?
if(isset($_GET['email']) && !empty($_GET['email']) AND isset($_GET['email_hash']) && !empty($_GET['email_hash'])){ // Verify data $search = "SELECT email, email_hash, active FROM users WHERE email='".$email."' AND hash='".$email_hash."' AND active='0'"; $match = $database->num_rows( $query ); if($match > 0){ //Fields and values to update $update = array( 'active' => 1 ); //Add the WHERE clauses $where_clause = array( 'email' => '$email', 'email_hash' => '$email_hash', 'active' => '1' ); $updated = $database->update( 'users', $update, $where_clause, 1 ); if( $updated ) { echo '<p>Your account has been activated, you can now login</p>'; } } }else{ echo '<p>Your account is already activated</p>'; }