显示来自多个表的数据并按值对其进行分组(PHP / MySQL)

I have a couple of tables that i feel different data inside based on user inputs, the tables contain different columns, so i want to create like a page something like user activity to show him/her everything what he was doing, now i have a couple of tables that hold data and i need somehow to select all the data based on one account number that all the tables contain it and display to the user based on the date, what i had until now is below:

global $wpdb;
global $userInfo;
$il_wpdb = new wpdb( DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);

This example with 2 tables only, but i have around 6 tables that i need to join them

$_IL_TABLE_NAME       = $wpdb->prefix . "il_complaints";
$_IL_TABLE_NAME1       = $wpdb->prefix . "il_internal_transfer";
$_IL_GET_COOKIES_VAL = $userInfo['account'];
//my query
$_IL_QUERY_RESULT = $il_wpdb->get_results( "SELECT $_IL_TABLE_NAME.il_date, $_IL_TABLE_NAME1.il_amount FROM $_IL_TABLE_NAME, $_IL_TABLE_NAME1 WHERE $_IL_TABLE_NAME.il_mt4_account='$_IL_GET_COOKIES_VAL' ");
//display data
foreach($_IL_QUERY_RESULT as $_IL_ROW){
    echo $_IL_ROW->il_date;
    echo $_IL_ROW->il_amount;
}

Because data will be displaed here from multiple tables how i can put to them something first raw is coming from first table and put to it table 1, the second row is coming from second table and to put to it table 2, to show to the user what he/she did and from where

I will appreciate any help.

try based on comments

$_IL_QUERY_RESULT = $il_wpdb->get_results( "
SELECT pr_il_complaints.il_date, pr_il_internal_transfer.il_amount
FROM pr_il_complaints t1 INNER JOIN pr_il_internal_transfer t2 ON t1.il_from_mt4 = t2.il_mt4_account;
");

You need a SQL JOIN, like this:

 SELECT t1.name, t2.salary  
FROM employee AS t1 INNER JOIN info AS t2 ON t1.name = t2.name;

SELECT t1.name, t2.salary
FROM employee t1 INNER JOIN info t2 ON t1.name = t2.name;

More: http://dev.mysql.com/doc/refman/5.0/en/join.html

try this...

$mysqli   = new mysqli("localhost", "username", "password", "database");
$strr     = "SELECT * FROM table1
             INNER JOIN tabel2
              ON table2.account_number = '".$something."'
             INNER JOIN tabel3
              ON table3.account_number = '".$something."'
            "; 
$result   = $mysqli->query($strr);
while($arr      = $result->fetch_array())
{
  echo "<pre>"; print_r($arr);  echo "</pre>"; 
}

You need to use joins

SELECT TN.il_date, TN2.il_amount , TNX.field...
FROM $_IL_TABLE_NAME TN
JOIN $_IL_TABLE_NAME1 T2 ON TN.ID_FIELD = TN2.ID_FIELD
JOIN $_IL_TABLE_NAMEX TX ON TX.ID_FIELD = DATABASE.FIELD
JOIN ...
WHERE $_IL_TABLE_NAME.il_mt4_account='$_IL_GET_COOKIES_VAL'

Extra Information: 1.-Sintaxis de JOIN 2.-Understanding JOINs in MySQL and Other Relational Databases