Problems with array replication and multi-table connectivity issues

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.