Let's take a look at an SQL statement! This post was last edited by u010250831 at 00:40:02
SQL as php mysql
The following is an SQL statement for the zen cart open-source mall system!
Select distinct p. products_id, p. products_image, p. products_tax_class_id, pd. products_name,
P. products_date_added, p. products_price, p. products_type, p. master_categories_id
From ". TABLE_PRODUCTS." p, ". TABLE_PRODUCTS_DESCRIPTION." pd
Where p. products_id = pd. products_id
And pd. aggregate age_id = '". (int) $ _ SESSION ['ages _ id']."'
And p. products_status = 1 ". $ display_limit;
In the preceding SQL statement, "p" and "pd" are aliases!
However, the [from ". TABLE_PRODUCTS." p, ". TABLE_PRODUCTS_DESCRIPTION." pd] clause does not use As when defining aliases. why? Is it an alias? Is there any other possible usage? Please kindly advise!
Reply to discussion (solution)
As can be left empty.
When running the SQL statement, directly output the SQL statement and put it in the editor for execution.
As writable or not
As depends on the situation, generally can not write,
However, some environment configurations require that the