User Tools

Site Tools


en:dev:all:examples:sql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:dev:all:examples:sql [18.02.2018 16:45] – [SELECT] Manuela v.d.Deckenen:dev:all:examples:sql [20.02.2019 07:49] (current) – [SELECT] Manuela v.d.Decken
Line 16: 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->doQuery("SELECT section_id, page_id, position, module, block, publ_start, publ_end FROM ".TABLE_PREFIX."sections where page_id= $iPageId and '.$iTimestamp.' between `publ_start` and `publ_end` order by block, position");+$oResult = $oDb->doQuery("SELECT section_id, page_id, position, module, block, publ_start, publ_end FROM ".TABLE_PREFIX."sections where page_id= $iPageId and $iTimestamp between `publ_start` and `publ_end` order by block, position");
 </code> </code>
 <code php Example-2.php>  <code php Example-2.php> 
Line 40: Line 40:
 $oResult = $oDb->doQuery($sql);      $oResult = $oDb->doQuery($sql);     
 </code>Let's have a short quiz now:\\ </code>Let's have a short quiz now:\\
-Question: Which of the examples are easier to read, to understand and to modify if required? **1**&**2**  or **3**&**4** ??+**Question:** Which of the examples are easier to read, understand and modify if required?\\ 
 +**Answers:** **1**&**2**  or **3**&**4** ??
 ---- ----
  
en/dev/all/examples/sql.1518972346.txt.gz · Last modified: 18.02.2018 16:45 by Manuela v.d.Decken