Jump to content

50gigs

Retired Forum Member
  • Posts

    3
  • Joined

  • Last visited

Everything posted by 50gigs

  1. To grab product pricings in your default currency <?php $result = mysql_query( 'SELECT `tblpricing`.`monthly`'. ' FROM tblpricing'. ' WHERE ((`tblpricing`.`relid` =3) AND (`tblpricing`.`currency` =1) AND (`tblpricing`.`type` ="product"))'. ' LIMIT 0, 30 ') or die(mysql_error()); $row = mysql_fetch_assoc($result); echo $row['monthly'];?> That code will do it for monthly pricing - the limit 0,30 can actually be removed! For annual <?php $result = mysql_query( 'SELECT `tblpricing`.`annually`'. ' FROM tblpricing'. ' WHERE ((`tblpricing`.`relid` =1) AND (`tblpricing`.`currency` =1) AND (`tblpricing`.`type` ="product"))'. ' LIMIT 0, 30 ') or die(mysql_error()); $row = mysql_fetch_assoc($result); echo $row['annually'];?> relid is your product id as specifiied in your other tab for your product in whmcs. You can pull product addons from the same code by changing type="product" to "addon"
  2. we wanted the same thing - to pull info from the whmcs db and use on another domain. Hence the weekend job
  3. quck how to make a file called dbconnect.php <?php mysql_connect("localhost", "database user", "password") or die(mysql_error()); mysql_select_db("database-name") or die(mysql_error()); ?> add in the database user and pw and database name in the right sections Save it. on any page you want to pull up the plan price add this <?php include("dbconnect.php"); ?> to get the pricing info from the whmcs database. $result = mysql_query( 'SELECT `tblpricing`.`annually`'. ' FROM tblpricing'. ' WHERE ((`tblpricing`.`relid` =25) AND (`tblpricing`.`currency` =1))'. ' LIMIT 0, 30 ') or die(mysql_error()); $row = mysql_fetch_assoc($result); echo $row['annually']; alter below to change product relid is the product code number = pid number Show different currency. change currency from 1 (1 is the default or first currency you entered) Also add your domain to the mysql remote hosts for the domain hosting your whmcs db
×
×
  • 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