This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Displaying price from MySQL
#1

Hello,

I've manually added 'price' field in MySQL table.
http://joxi.net/LmGMEZ8UwyR0PA

How to display the information from this 'price' field with Extractor?
For example, interesting in "public function pageRating($cmtx_identifier)".
I want to display rating and price from pageRating function.

Thanks for future help.
Reply
#2

Hi Tim,

Change this:
PHP Code:
<?php 
"SELECT `id`

To this:
PHP Code:
<?php 
"SELECT `id`, `price`

Change this:
PHP Code:
<?php 
return $average;

To this:
PHP Code:
<?php 
return array('average' => $average, 'price' => $page['price']);

Change this:
PHP Code:
<?php 
echo $extractor->pageRating('1');

To this:
PHP Code:
<?php 
$rating
= $extractor->pageRating('1');
if (
is_array($rating)) {
echo
$rating['average'];
echo
$rating['price'];
} else {
echo
$rating;
}

Have you completed the interview?
Reply
#3

Cool...!
Working.
Thanks a lot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)