Note that there are some explanatory texts on larger screens.

plurals
  1. POTYPO3 include PHP function and SQL query
    text
    copied!<p>Have search the net, but can't find any fix/help.</p> <p>Im running TYPO3 v.6. Extbase/Fluid im trying to do 2 things.</p> <ol> <li>Including a php page, and show it in a content element on a page.</li> <li>trying to get some data from a MySQL db, and show it in a content element.</li> </ol> <p>I have included a php page in a TS page like.</p> <pre><code>lib.timmers = USER_INT lib.timmers { includeLibs.time = fileadmin/templates/add/php/dates.php userFunc = custom_class-&gt;customfunction } </code></pre> <p>And have then installed the Extension tscobj, its working with Return commands in the PHP page, but not with Echo and Print. If i take the includeLibs.time and place it outside the lib.timmer, then it shows the php content, but before the HTML tag..</p> <p>So i have problems getting included php content inside a content element on a page.</p> <p>And How can I add a MySQL connection and make some HTML code/layout, so i can get records from a DB inside a content element, i have tryed the extension ViewHelper, but its not working.</p> <p>Can someone help me.</p> <p>Edit:</p> <p>I have tryed this code, but im not getting any data..</p> <pre><code>lib.GetMainCat = CONTENT lib.GetMainCat { wrap = &lt;div class="p_filter"&gt;&lt;div class="p_filter_container"&gt;&lt;a class="p_cat_filter button" href="#" title="All Categories" data-filter="article.portfolio"&gt;&lt;span&gt;All Categories&lt;/span&gt;&lt;/a&gt;&lt;ul class="p_filter"&gt;&lt;li class="current"&gt;&lt;a href="#" title="All Categories" data-filter="article.portfolio"&gt;All Categories&lt;/a&gt;&lt;/li&gt;|&lt;/ul&gt;&lt;/div&gt;&lt;div class="cl"&gt;&lt;/div&gt;&lt;/div&gt; table = tx_tbpdrills_domain_model_drillcategory select { selectFields = * where = NOT deleted AND NOT hidden orderBy = categorytitle ASC } renderObj &gt; renderObj = COA_INT renderObj { 10 = TEXT 10.field = categorytitle 10.wrap = &lt;li&gt;&lt;a href="#" title="###" data-filter="article.portfolio[data-category~='###']"&gt;|&lt;/a&gt;&lt;/li&gt; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload