Welcome Guest, Not a member yet? Register   Sign In
Get data from mysql and merge instead of joins
#6

(This post was last modified: 04-03-2017, 02:48 PM by spjonez.)

PHP Code:
$this->data'user' ] = array_merge$array1$array2$array3 ); 

This will overwrite data under the same key based on the order you pass them in as unless each array contains unique keys.

If you can't guarantee unique keys something like this would be better suited:

PHP Code:
$this->data'user' ] = array( );
$this->data'user' ][ 'data' ] = $this->user->...
$this->data'user' ][ 'related' ] = $this->related->... 

If you use 10 queries instead of one your code will be noticeably slower. Choosing your platform at the start is an important distinction to make I wouldn't try to support both variants unless you have to.
Reply


Messages In This Thread
RE: Get data from mysql and merge instead of joins - by spjonez - 04-03-2017, 02:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB