import other tables to the detailed listing

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 27, 2011   (RSS)

By loccom - June 25, 2011

Hi

I am having a small problem, in my detailed listing page i want to import another table from the CMS. This works if i go to the detailed page directly with no query but as go to a product query ie: "productInfo.php?6" the record does'nt work.

here is my header:

<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php


// load viewer library
$libraryPath = 'cms/lib/viewer_functions.php';
$dirsToCheck = array('/home/websitem/public_html/sites/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

// load records
list($healthgood_productsRecords, $healthgood_productsMetaData) = getRecords(array(
'tableName' => 'healthgood_products',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));


$healthgood_productsRecord = @$healthgood_productsRecords[0]; // get first record


// load records
list($popular_productsRecords, $popular_productsMetaData) = getRecords(array(
'tableName' => 'popular_products',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$popular_productsRecord = @$popular_productsRecords[0]; // get first record

// load records
list($product_linksRecords, $product_linksMetaData) = getRecords(array(
'tableName' => 'product_links',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$product_linksRecord = @$product_linksRecords[0]; // get first record


// show error message if no matching record is found
if (!$healthgood_productsRecord) { dieWith404("Record not found!"); }

?>


Can anyone help me please?

Re: [Damon] import other tables to the detailed listing

By loccom - June 27, 2011

awesome.. thank you so much!