Prestashop - 1.4 Guia Do Programador

Página de 36
2.   
3.  SELECT `firstname` 
4.  FROM `'. _DB_PREFIX_.'customer` 
5.  Back quotes ("`") must be used around field names and table 
names  
6.   
7.  SELECT p.`foo`, c.`bar` 
8.  FROM `'. _DB_PREFIX_.'product` p, `'. _DB_PREFIX_.'customer` c 
9.  Table aliases have to be make by taking the first letter of each 
word, and must be 
lowercase  
10.   
11.  SELECT p.`id_product`, pl.`name` 
12.  FROM `'. _DB_PREFIX_.'product` p 
13.  NATURAL JOIN `'. _DB_PREFIX_.'product_lang` pl 
14. 
When conflicts between table aliases occur, the second 
character has to be taken too  
15.   
16.  SELECT ca.`id_product`, cu.`firstname` 
17.  FROM `'.DB_PREFIX.'cart` ca, `'. _DB_PREFIX_.'customer` cu 
18. 
Indentation has to be done for each clause  
19.   
20.  $query = 'SELECT pl.`name` 
21.  FROM `'.PS_DBP.'product_lang` pl 
22.  WHERE pl.`id_product` = 17'; 
23. 
It’s forbidden to make a join in WHERE clause