gabe Posted February 14, 2015 Share Posted February 14, 2015 Instead of searching for the client through their IDs, I want to search it through their customfields, specifically customfields1. Here's an example of how I tried to achieve it (and failed): $postfields["action"] = "getclientsdetails"; //$postfields["clientid"] = "100"; $postfields["customfields1"] = "14.111.580000180"; The code above does not work, it fetches the first client details. Is there a way to do this? 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 14, 2015 Share Posted February 14, 2015 i think you may need to build your own SQL Query to achieve this 0 Quote Link to comment Share on other sites More sharing options...
gabe Posted February 14, 2015 Author Share Posted February 14, 2015 You mean query whmcs mysql database on each client until customfield = the one I'm looking for? I tried encapsulating the whole code on a while loop and search through each client until I get a match on the custom fields. This works, but the search takes forever because each loop has to load the API all over again. 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 14, 2015 Share Posted February 14, 2015 you can simply do it with one query, i don't what exactly you need to do but as an example i can select clients information when customfield1 >= 1 : SELECT `tblclients`.*, `tblcustomfieldsvalues`.* FROM `tblclients`, `tblcustomfieldsvalues` WHERE `tblclients`.`id`=`tblcustomfieldsvalues`.`relid` AND `tblcustomfieldsvalues`.`fieldid`='1' AND `tblcustomfieldsvalues`.`value`>1 try it in PHPMyAdmin to see how its work 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.