Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6011657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:17:30+00:00 2026-05-23T02:17:30+00:00

A snip of code $LoginRS__query=sprintf(SELECT user_handle, user_password FROM users_entity WHERE user_handle=%s AND user_password=%s AND

  • 0

A snip of code

$LoginRS__query=sprintf("SELECT user_handle, user_password FROM users_entity WHERE user_handle=%s AND user_password=%s AND activation_status='Active'",
    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 

  $LoginRS = mysql_query($LoginRS__query, $f12_database_connect) or die(mysql_error());
  $loginFoundUser = mysql_num_rows($LoginRS);
  if ($loginFoundUser) {
     $loginStrGroup = "";


    //declare two session variables and assign them
    $_SESSION['MM_Username'] = $loginUsername;
    $_SESSION['logged_in']="True";
    $_SESSION['MM_UserGroup'] = $loginStrGroup;       

    if (isset($_SESSION['PrevUrl']) && true) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];  
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }
}

The database queries users that are activation_status="Active". That field has either of the two values which are "Pending" or "Active". I want to send to another page if the status is "Pending". The page would be for users that haven’t activated their account. How do grab that result and assign it to a variable? Or is there a better approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:17:30+00:00Added an answer on May 23, 2026 at 2:17 am

    Just select the data without referring to the activation_status and check it with an if statement.

    EDIT:

    The code you are probably looking for:

    $LoginRS__query=sprintf("SELECT user_handle, user_password, activation_status FROM users_entity WHERE user_handle=%s AND user_password=%s",
        GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text")); 
    
      $LoginRS = mysql_query($LoginRS__query, $f12_database_connect) or die(mysql_error());
      $loginFoundUser = mysql_num_rows($LoginRS);
      if ($loginFoundUser) {
        // Make sure user is activated.
        $row = mysql_fetch_Array($LoginRS);
        if ($row['activation_status'] === 'Pending') {
          header("Location: some-other-page");
        }
    
        $loginStrGroup = "";
    
    
        //declare two session variables and assign them
        $_SESSION['MM_Username'] = $loginUsername;
        $_SESSION['logged_in']="True";
        $_SESSION['MM_UserGroup'] = $loginStrGroup;       
    
        if (isset($_SESSION['PrevUrl']) && true) {
          $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];  
        }
        header("Location: " . $MM_redirectLoginSuccess );
      }
      else {
        header("Location: ". $MM_redirectLoginFailed );
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following code (that doesn't work): while True: # Snip: print out current
I am trying to translate this centering code snip in Objective-C into MonoTouch imageView.frame.origin.x
here is my code snip, i dont know how to round double numbers. double
using the following snip of code to access a url with a post. i
Code snip 1) does not compile, and I need e.g. to make the cast
Consider this piece of code: class A { void methodX() { // snip (1
In an older version of our code, we called out from Perl to do
I have pasted a code snip below that I have written which reads a
I am trying to make following snip of code lockless using interlocked operations, Any
I'm getting a syntax error on this PHP code: <snip> $last = (isset($_GET['last']) &&

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.