Incuding two different type of information from the same table on one page

2 posts by 2 authors in: Forums > CMS Builder
Last Post: September 15, 2009   (RSS)

Hi,

I’m having an issue were by I want to display a detail page of an item but want to also list other items in the same category from the same table in the database
For example:

I have a page that lists everything with the category of “Invoicing Module” when I click on this record from the list it opens up a details page to give me the full details about this Invoicing Module Bugfix the tricky bit come when I want to list of other programs that are in the same category of “Invoicing Module” in date descending order (the date bit I can do)

I have tried to create a include page and add a query string to the end but that stops the page from working. I think is the easiest way to go but was unable to get the query string to work

I tried various different ways like the example below:

<?php include inc.php?program='echo $releasenotesRecord['module']?>

and

<?php include("inc.php?program="echo $releasenotesRecord['program'] ); ?>

I did manage to get the page to display what I wanted the include to do by doing the following:

<?php $location = " inc.php?program=";
echo $location; echo $releasenotesRecord['program'] ?>

But how do I get this to work as an include? In the past I have normally needed to include or add the extra functions to pull from a different tables and have been able to do that by using WERE commands at the top and adding this code (standard stuff)

require_once " /lib/viewer_functions.php";
list($releasenotesRecords, $releasenotesMetaData) = getRecords(array(
'tableName' => 'releasenotes',
'perPage' => '10',
));

?>
Also I could do with excluding the current record as well from the list if we use an include to query the list of items in the same catagory then it will obviously include the item we are on.

I thought I could exclude this by using the record number but this would also need to be added to the query string at the end of the include.

Hope this is clear I know it’s sometimes hard to grasp what other people are trying to achive, need any more info let me know

Cheers you Guys