The og. id, og. orderid: orderid, gong. id, what does pdo_fetchall ("select og. id, og. realprice, og. total, g. hascommission, g. nocommission, g. commissionraterate, g. commission1_pay, g. commission2_rate, g. commission2_pay, g. commission3_rate, g. commission3_pay from ". tablename (shop_order_goods '). 'og '. 'Left join '. tablename ('shop _ goods '). 'G on g. id = og. goodsid '. 'Where og. orderid =: orderid and og. uniacid =: uniacid ', array (
': Orderid' => $ orderid,
Og. such as og. id and og. realprice are added before each field. what does this mean?
The database has the id and goodsid fields, but what does the form g on g. id mean.
And og. uniacid =: og such as uniacid. what does the colon mean after the equal sign?
Reply to discussion (solution)
XXX. xxx XXX is an alias
: Uniacid is the parameter name for parameter passing.
XXX. xxx XXX is an alias
: Uniacid is the parameter name for parameter passing.
Is the alias casually named? What is the alias used for? what is the difference between this alias and the field used directly?
G on g. id. There are also letters, spaces, and letters in front of the dot.
Og may be an alias or a database name.
For example
Select * from member as a where a. uid = 1; here a is the alias of member
Select * from abc. member; here abc is the database name.
For your
... From ". tablename (shop_order_goods '). 'og'. 'left join'. tablename ('shop _ goods '). 'G...
Tablename (shop_order_goods ') and tablename ('shop _ goods') return the table name, which is not a definite value.
In the association expression on g. id = og. goodsid, if g and og do not use aliases, they have to call those two functions, which is very bloated.
Og may be an alias or a database name.
For example
Select * from member as a where a. uid = 1; here a is the alias of member
Select * from abc. member; here abc is the database name.
What is the meaning of an alias?
Og may be an alias or a database name.
For example
Select * from member as a where a. uid = 1; here a is the alias of member
Select * from abc. member; here abc is the database name.
What is the meaning of an alias?
It can be written shorter.
For example, if your table name is information_schema_member and information_abc, you need to join
Do not use aliases
Select information_schema_member.name, information_abc.addtime from information_schema_member join information_abc on information_schema_member.id = information_abc.uid;
Use alias
Select a. name, B. addtime from information_schema_member as a join information_abc as B on a. id = B. uid;
Og may be an alias or a database name.
For example
Select * from member as a where a. uid = 1; here a is the alias of member
Select * from abc. member; here abc is the database name.
What is the meaning of an alias?
It can be written shorter.
For example, if your table name is information_schema_member and information_abc, you need to join
Do not use aliases
Select information_schema_member.name, information_abc.addtime from information_schema_member join information_abc on information_schema_member.id = information_abc.uid;
Use alias
Select a. name, B. addtime from information_schema_member as a join information_abc as B on a. id = B. uid;
After the join operation is completed, the alias can be used for other database calls?
Og may be an alias or a database name.
For example
Select * from member as a where a. uid = 1; here a is the alias of member
Select * from abc. member; here abc is the database name.
What is the meaning of an alias?
It can be written shorter.
For example, if your table name is information_schema_member and information_abc, you need to join
Do not use aliases
Select information_schema_member.name, information_abc.addtime from information_schema_member join information_abc on information_schema_member.id = information_abc.uid;
Use alias
Select a. name, B. addtime from information_schema_member as a join information_abc as B on a. id = B. uid;
It seems so. thank you.