WHMCS native select_query function
There’s no reason to explain why do we need to make SQL queries inside custom files, modules etc.
Most of examples on the net use mysql_query function. But sometimes it would be reasonable to use native WHMCS function select_query. Or at least to know how it works.
Parameters:
- $table
- $fields
- $where
- $orderby
- $orderbyorder
- $limit
- $innerjoin
Example:
$result = select_query("tblhosting", "nextduedate, billingcycle, lastupdate", array("id"=>$params['serviceid'])); $data = mysql_fetch_array($result);
Unfortunately I cannot say default values and their types. I guess strings and arrays are allowed.
I like the way it standardized. But it is always good to have control over function results etc. So a better way would be to include something powerfull like doctrine.