2017-05-06, 09:10 AM
Getting Multiple records from single table is good if we compare to multiple queries. In my plugin, i've seen i am using upto 4-5 queries. 2 queries from a single table and 2 queries from another table.
i want to join queries in single query.
Queries:
FIRST
SECOND
if both queries execute in single statement then it will very useful...
In the same function, i've two another queries like this for second table
i want to join queries in single query.
Queries:
FIRST
//fetch referrer from, need to add this query because this action can be done by mods/admin so can't use $mybb->user['uid']
$query = $db->simple_select("users", "postnum,referrer,referrerstatus", "`uid` = '".$uid."'");
// getting data
$results = $db->fetch_array($query);
SECOND
// getting referrer information
$query = $db->simple_select("users", "referrals", "`uid` = '".$results['referrer']."'");
$results = $db->fetch_array($query);
if both queries execute in single statement then it will very useful...
In the same function, i've two another queries like this for second table