Forum

Thread tagged as: Question, Problem, Error

Adding included for star rating

I'm using PHP/sql Star rating, which must have an include (see below). Adding this to page template, makes the page blnk.

<?php include('/dbconfig.php'); 
//Fetch rating deatails from database
$query = "SELECT rating_number, FORMAT((total_points / rating_number),1) as average_rating FROM post_rating WHERE post_id = 1 AND status = 1";
$result = $db->query($query);
$ratingRow = $result->fetch_assoc();
?>

Edward Johansen

Edward Johansen 0 points

  • 4 years ago

If the page is blank... white screen then you likely have a pho error.

You will need to check error logs on server to find out what's failing.

Well, before that line, I have the Runway include

<?php if (!defined('PERCH_RUNWAY')) include($_SERVER['DOCUMENT_ROOT'].'../pwcms/runtime.php'); ?>
Rachel Andrew

Rachel Andrew 394 points
Perch Support

This doesn't appear to be Perch related, but an issue with your custom PHP. We can't support any and all PHP here, I would contact the developer of that script.