Jump to content

How to correct code to display message only to domainstatus=Active in tblhosting?


paperweight

Recommended Posts

I want to display a short message to only users who have a Paid product in the domainstatus=Active in the tbhosting. I put together the code below but it seems to be wrong somewhere and I can not figure what I did incorrect:

 

 

{php}
// BEGIN TO CHECK IF USER HAS PAID PRODUCT OR NOT
// take the user's id
$userID = $_SESSION["uid"];
// try to find that user among tblhosting to see if they in fact have an Active product	
$sql = "SELECT id FROM tblhosting WHERE domainstatus='Active' AND userid = ".$userID;
$result = mysql_query($sql);
$rows = mysql_num_rows($result);
// if found
if ($rows > 0)
{
	$this->assign('isPAIDClient',"Y");
}
// if not
else
{
	$this->assign('isPAIDClient',"N");
}
// END TO CHECK IF USER HAS PAID PRODUCT OR NOT
{/php}
{if $isPAIDClient eq "Y"}show this...{/if}
{if $isPAIDClient eq "N"}show this other content...{/if}

 

I think I made a mistake on the $rows but I'm unclear if I should show >1 or something else?

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated