I want to join (inner join) two table with a mysql query. I want it to return all content blocks of the name "page summary" (additional content block in template) of pages underneath a specific content_id.
The idea is to use this tag to create an overview (index template) of underlying pages, based on what is stated on the single pages second content block "summary".
When I am in the db management and I run the following query, I get just the result i want:
Code: Select all
SELECT parent_id, content_alias, show_in_menu, active, cms_content_props.content_id, prop_name, content
FROM cms_content, cms_content_props
WHERE cms_content.content_id = cms_content_props.content_id AND prop_name="summary" AND parent_id= 34 Code: Select all
1: global $gCms;
2:
3: $db = &$gCms->db;
4:
5: $q= "SELECT parent_id, content_alias, show_in_menu, active, ".cms_db_prefix()."content_props.content_id, prop_name, content
6: FROM ".cms_db_prefix()."content, ".cms_db_prefix()."content_props
7: WHERE ".cms_db_prefix()."content.content_id = ".cms_db_prefix()."content_props.content_id AND prop_name="summary" AND parent_id= 36";
8:
9: $dbresult = $db->Execute( $q);
...
I already spent quite a few hours finding out what causes this , but I still haven't figured out the problem. Does anyone of you have a tipp on how to solve this problem? Or what I have to look for to find the answer?* Invalid code entered.
* Parse error: parse error, unexpected T_STRING in /homepages/3/d116996210/htdocs/opticalvalve/content/admin/edituserplugin.php(105) : eval()'d code on line 7
CMS Made Simple 1.1
Apache 1.3.33 (Unix)
MySQL 4.0.25
PHP Version 4.4.7
Greetings from Hamburg
Nils

