When OpenID equals the Mendian field in the current Openid,order table and the contents of the ID field in Mendian, the order table is associated Mendian with the order form, and the data in the table order is taken out.
, (as M and as O are the store table as M, the order table as O)
SELECT * from ' order ' as O left join ' Mendian ' as M in M.id=o.mendian where O. ' OpenID ' = ' $openid ' ORDER by O.id DESC
The OrderID data in the order table is not available, the exclusion error found that two tables have common field OrderID, so use the following statement
Write the fields directly from each table you need to take out
SELECT ' order '. ' OrderID ', ' order '. ' Strshow ', ' order '. ' Create_time ', ' order '. ' Notes ', ' Mendian '. ' Corp_name ' from ' Orde R ' left JOIN ' Mendian ' on ' mendian '. id = ' order '. Mendian WHERE ' order '. ' OpenID ' = ' $openid ' ORDER by Order.id DESC
"MYSQL" left joins on multiple table association queries (field resolution with duplicate names in the queried table)