This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:dev:all:examples:sql [16.07.2015 22:08] – [REPLACE] translated mrbaseman | en:dev:all:examples:sql [20.02.2019 07:49] (current) – [SELECT] Manuela v.d.Decken | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | FIXME **This page is not fully translated, yet. Please help completing the translation.**\\ //(remove this paragraph once the translation is finished)// | ||
| - | |||
| ====== This is how SQL works... ====== | ====== This is how SQL works... ====== | ||
| Line 18: | Line 16: | ||
| Each of all the four examples give back a result-object with all records of the visible sections of a page at the current time. | Each of all the four examples give back a result-object with all records of the visible sections of a page at the current time. | ||
| <code php Example-1.php> | <code php Example-1.php> | ||
| - | $oResult = $oDb-> | + | $oResult = $oDb-> |
| </ | </ | ||
| <code php Example-2.php> | <code php Example-2.php> | ||
| $sql = ' | $sql = ' | ||
| - | $sql .= 'WHERE `page_id`=' | + | $sql .= 'WHERE `page_id`=' |
| $sql .= 'ORDER BY `block`, `position`'; | $sql .= 'ORDER BY `block`, `position`'; | ||
| $oResult = $oDb-> | $oResult = $oDb-> | ||
| Line 31: | Line 29: | ||
| . 'FROM `' | . 'FROM `' | ||
| . 'WHERE `page_id`=' | . 'WHERE `page_id`=' | ||
| - | | + | |
| - | | + | |
| . 'ORDER BY `block`, `position`'; | . 'ORDER BY `block`, `position`'; | ||
| $oResult = $oDb-> | $oResult = $oDb-> | ||
| Line 39: | Line 36: | ||
| $sql = ' | $sql = ' | ||
| . 'WHERE `page_id`=' | . 'WHERE `page_id`=' | ||
| - | | + | |
| - | | + | |
| . 'ORDER BY `block`, `position`'; | . 'ORDER BY `block`, `position`'; | ||
| $oResult = $oDb-> | $oResult = $oDb-> | ||
| </ | </ | ||
| - | Question: Which of the examples are easier to read, to understand and to modify if required? **1**& | + | **Question:** Which of the examples are easier to read, understand and modify if required?\\ |
| + | **Answers: | ||
| ---- | ---- | ||