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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.