Jump to content

General querying question for hosting add-ons.


Eric4gh

Recommended Posts

Hi everyone. I wonder if anyone would know how to query WHMcs to see if a certain product add-on has been added to an order. This would be a very similar query to what is written into invoices.php - that lists hosting add-ons. (although I can't see it because the file is encoded.)

 

I see that this type of information is stored in table: tblhostingaddons - and there are three identifying columns "id", "orderid", and "hostingid"

 

However, I am not the best at creating queries.

 

The goal is to take an action based if on order includes an add-on for Sitebuilder access.

 

This column name where the add-on is named is "name" and if this column contains text "Sitebuilder Access" - then the query should return positive.

 

Thank you for your help. :|

Link to comment
Share on other sites

I imagine it would be something along the lines of this this SQL query:

 

$qresult = mysql_query("select * FROM tblhostingaddons WHERE $vars["accountid"] eq hostingid AND name='Sitebuilder Access'");

if(mysql_num_rows($qresult) > 0) {

// create new sitebuilder site

} else {

// customer does not have a Addon

}

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