Jump to content

Name of a function??


perryratcliff

Recommended Posts

$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password = md5('$mypassword')";
$result=mysql_query($sql); 

So the user logging in should be stored in $result. The $tbl_name has a column called 'active'. How would I go about checking if $result's active was == to 1

 

Basically something like

if $result 'active' == 1 {

 

Thanks for the help!

Link to comment
https://forums.phpfreaks.com/topic/223037-name-of-a-function/
Share on other sites

Thanks!

I just added a second if

if($count==0){
$testactive="SELECT * FROM $tbl_name WHERE username='$myusername' and password = md5('$mypassword')";
$activer=mysql_query($testactive);
  if (mysql_num_rows($activer) == 1) {
    $data = mysql_fetch_assoc($activer);
    $active = $data['active'];
    if($actve==0){
      echo 'Please check your email and confirm your account';
    }
  }
  if (mysql_num_rows($activer) == 0) {
    echo 'Wrong Username or Password';
  }
}
?>

 

Works great!

Link to comment
https://forums.phpfreaks.com/topic/223037-name-of-a-function/#findComment-1153183
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.