Jump to content

User levels


techker

Recommended Posts

hey guys im doing a dealership script for my body and i have a user section.now when we creat a user i set levels.

 

like 1 is full dealer price

      2 is retail price

      3 is retail -

 

so now im wondering how can i do it that it can check the level(thats ok with a querry)

 

$sql = "SELECT Level FROM $tbl_name WHERE ID = $ID";
$result = mysql_query($sql);

 

now i have my php echo

 

echo $info['Retail_price']

 

can i do something like

 

//echo (empty($row['d'])? "empty": "not empty"); //result not empty

 

but for level?

Link to comment
https://forums.phpfreaks.com/topic/197936-user-levels/
Share on other sites

$level = (empty($row['Level'])) ? $row['level'] : 0;

 

If you want to test if the level is = 0 or null then you would change the empty logic. But empty checks if $row['level'] is 0 or "" etc. So it is still valid. It does not check null variables though. If it can be null use is_null.

Link to comment
https://forums.phpfreaks.com/topic/197936-user-levels/#findComment-1038693
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.