Jump to content

[SOLVED] putting data from sql into a variable then using it


rhale

Recommended Posts

what i am trying to do is just get a value from sql and then put it into a variable, it prints out the right value but when i try to use it in the if statement below it just doesnt work and i get no error or anything

 

$accesslevels = mysql_query("SELECT accesslevel FROM $tbl_name WHERE username='$myusername' and password ='$mypassword'");
$accesslevel = mysql_fetch_assoc($accesslevels);


if($accesslevel=='2'){
echo $accesslevel['accesslevel'];  
} 

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.