Array Assignment problems
$_a = array(1,2,3,4,5);
$_b = Array(' A ', ' B ', ' C ', ' d ', ' e ');
$_data = array();
If you want to add $_a,$_b to the array $_data,
Can not be used
$_data = $_a;
echo $_data; Array (1,2,3,4,5)
$_data = $_b;
echo $_data; Array (' A ', ' B ', ' C ', ' d ', ' e ')
Not an array ((1,2,3,4,5), (' A ', ' B ', ' C ', ' d ', ' e ')
Because this is a simple assignment, it is not added, the correct wording is as follows
$_data[] = $_a;
$_data[] = $_b;
echo $_data; Array ((1,2,3,4,5), (' A ', ' B ', ' C ', ' d ', ' e '))
1. For multiple table left connection, usage and two tables are the same
$sql = "Select
A.id,a.name,b.score,c.level
From Ec_orders as a
Left JOIN Ec_account as B on a.id = b.ID
Left JOIN Ec_goods_brands as C on a.brands_id = C.id
WHERE A.is_del = 0 and B.is_del = 0 and C.is_del = 0 ";
A.id,a.name,b.score,c.level is the data you want to find out, note that the prefix table alias (a,b,c) do not forget to add, otherwise you will not know to query which table and error,
The LEFT join Ec_account as B on a.id = b.id the connection query A, B two table record of the same ID,
Left joins Ec_goods_brands as C on a.id = C.id similarly
Where is a conditional judgment statement
Problems with array replication and multi-table connectivity issues