dbquery("SELECT o.*, i.* FROM ".DB_ORDERS." o INNER JOIN ".DB_ITEMS." i ON o.order_item=i.item_id");
Quote
JoiNNN wrote:
See http://php.net/manual/en/function.array-merge.php.
You'll have to do something like
$result1 = dbarray(dbquery(SELECT * ...
$result2 = dbarray(dbquery(SELECT * ...
$result3 = array_merge($result1, $result2);
and then you have to check if there are any results like
if (empty($result3)) {
//there ARE NO results
} else {
//there ARE some results
}
-- not tested, dunno if dbarray returns empty arrays if there's no result or how array_merge() acts when merging empty arrays --
Quote
KasteR wrote:
Maybe someone can provide an example (sorry I'm unable to at the moment). But what about a UNION QUERY on the SQL side?
Ref: http://www.w3schools.com/sql/sql_union.asp
It would be an alternative, if you're unable to use array_merge as JoiNNN has suggested. This would eliminate the need for a merge, as you're doing this from the query.
Category Forum
Code Snippet and functions - 8Labels
None yet
Statistics
4 participants
Notifications
You are not receiving notifications from this thread.
Related Questions