Price chart cannot be displayed

trade.epizy.com

(average price chart is displayed in my localhost server, however I can’t display the same file in my website using infinityfree free domain)

##shows empty page only.

(please share the FULL error message you see, if applicable)

Other Information

(other information and details relevant to your question)

If you need help, provide more info.
Please indicate what is missing and what is supposed to show.
Screenshots will be good

I only see this

image

Make sure file is available

3 Likes

The missing is price chart display

<?php echo PriceInfoDataTable; ?>

<?php echo CPAMP; ?>    :  <?php echo WeeklyData; ?>

    <?php

    $dataset = "";
    $average_producer_price = 0;
	$average_wholesale_price = 0; 
	$average_retail_price = 0; 
	$date = "";

    $db = new DBConnection();
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
	 $db->PrepareStatement("SELECT * FROM `crop_products_price`");
	  $db->stmt->execute();
    $rowCount = $db->stmt->rowCount();
	    if ($rowCount > 0) {
		?>
        <?php
        $cnt = 0;
        while ($row = $db->stmt->fetchObject()) {
            $cnt++;
            $crop_products_price_id = $row->ID;
            $office_type_id = $row->office_type_id;
			$established_markets_id = $row->established_markets_id;
		//	$weekdays_id = $row->weekdays_id;
		//	$crop_products_category_id = $row->crop_products_category_id;
			$crop_products_id = $row->crop_products_id; 
			$units_id = $row->units_id;			
            $date = $row->date; 
			
			$producer_price1 = $row->producer_price1;
			$producer_price2 = $row->producer_price2;
			$producer_price3 = $row->producer_price3;
			
			$wholesale_price1 = $row->wholesale_price1;
			$wholesale_price2 = $row->wholesale_price2;
			$wholesale_price3 = $row->wholesale_price3;
			
		    $retail_price1 = $row->retail_price1;
			$retail_price2 = $row->retail_price2;
			$retail_price3 = $row->retail_price3;
			
			$sum = round(($row->producer_price1 + $row->producer_price2 + $row->producer_price3 + $row->wholesale_price1 + $row->wholesale_price2 + $row->wholesale_price3 + $row->retail_price1 + $row->retail_price2 + $row->retail_price3), 2);
			$average_producer_price = round(($row->producer_price1 + $row->producer_price2 + $row->producer_price3)/3, 2);
			$average_wholesale_price = round(($row->wholesale_price1 + $row->wholesale_price2 + $row->wholesale_price3)/3, 2);
			$average_retail_price = round(($row->retail_price1 + $row->retail_price2 + $row->retail_price3)/3, 2);
			
			if (GetLang() == Amharic) {
                $OfficeType = Row("office_type" , $office_type_id)->title_am;
				$market_place = Row("established_markets" , $established_markets_id)->specific_place_am;
			//	$market_day = Row("weekdays" , $weekdays_id)->day_am;
			//	$crop_products_category = Row("crop_products_category" , $crop_products_category_id)->cat_name_am;
				$crop_name = Row("crop_products" , $crop_products_id)->crop_name_am;
				$units = Row("units" , $units_id)->unit_am;
            } else {
                $OfficeType = Row("office_type" , $office_type_id)->title_en;					
				$market_place = Row("established_markets" , $established_markets_id)->specific_place_en;
			//	$market_day = Row("weekdays" , $weekdays_id)->day_en;
			//	$crop_products_category = Row("crop_products_category" , $crop_products_category_id)->cat_name_en;
				$crop_name = Row("crop_products" , $crop_products_id)->crop_name_en;
				$units = Row("units" , $units_id)->unit_en;				
            }
				
		   $dataset .= "
        {
			label : '".$date."',
			y: ".$average_retail_price.", 
        },";	
		
        ?>
		
		   <?php
        }
        $db = null;
        } else {
            echo Alert(EmptyData , INFO);
        }
        ?>	
<?php echo " "; ?>

What have you tried so far to debug it? Have you compared the HTML generated by your PHP code locally and on your live site? Did you try var_dump-ing the row count and contents of rows to verify the same data is being returned?

It’s your code, you’re supposed to know how it works and fix it if it doesn’t. “But it works on my machine” doesn’t mean that it’s a hosting problem. At least 9/10 times, it turns out that the data is different, the configuration is incorrect or the code isn’t even the same.


If you’ve tried troubleshooting it yourself and really got stuck, or found something that clearly shows that the hosting is not working as intended (and again, “works on my machine” isn’t that), we can help you, but we need a LOT more information to do that. Such as:

  • Where exactly on your site can we find this chart?
  • What does the chart look like for you locally and what does it look like here (share screenshots)?
  • What have you tried so far to debug it and what did you find?
4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.