I’m in the process of going through the entire plugin and revising all usage of pods_query to utilize an array of objects (which is what $wpdb->get_results returns), as well as a few other updates to formatting.
Here’s a few I’m looking to get some input on —
pods_query() usage
I’m seeing pods_query used in two ways:
$sql = "SELECT ............. ";
$result = pods_query($sql);
$result = pods_query("SELECT ............. ");
Regardless of if it’s a SELECT statement, what should be the proper usage and when? If $sql is multi-line, or large it should be as $sql, otherwise it should be contained within pods_query() itself. Is that safe to assume?
array usage
How should arrays be formatted?
$variable = array('key'=>'value','key2'=>'value2');
or
$variable = array('key' => 'value','key2' => 'value2');
or
$variable = array('key'=>'value',
'key2'=>'value2');
or
$variable = array('key' => 'value',
'key2' => 'value2');