PHP warning

Division by zero

/home/holylama/public_html/themes/user/views/product/details.php(204)

192             </div>
193             <!--end-->
194             
195             
196             
197             <?php 
198                  $actualPrice=$details[0]['price'];
199                 
200                  $specialPrice=$details[0]['special_price'];
201                  //echo $actualPrice;echo "<br />";
202                  //echo $specialPrice;
203                  $difference=(int)$actualPrice-(int)$specialPrice;
204                  $discount=round(($difference/$actualPrice)*100);
205                  if($specialPrice=='0')
206                 {
207                     $display_price = $actualPrice;
208                     $discount = 0;
209                 }
210                 else
211                 {
212                     $display_price = $specialPrice;
213                     //$discount = ($specialPrice*100)/$actualPrice;
214                 }
215                  ?>
216             

Stack Trace

#4
+
 /home/holylama/public_html/protected/controllers/ProductController.php(553): CController->render("details", array("details" => array(), "name" => null, "detailsImage" => array(), "detailsImagefirst" => null, ...))
548         $detailsImagefirst=$model2->find(array('order'=>'gall_priority', 'condition'=>'ctg_id=:x', 'params'=>array(':x'=>$pid)));
549         
550        
551         
552         $this->layout="subpage";
553         $this->render("details",array('details'=>$details,'name'=>$name,'detailsImage'=>$detailsImage,'detailsImagefirst'=>$detailsImagefirst,'user'=>$user));
554     }
555     public function actionCheckout()
556     {
557          
558          if(Yii::app()->request->isPostRequest)
#14
+
 /home/holylama/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-28 16:44:36 Apache Yii Framework/1.1.14