PHP warning

Undefined variable $i

/home3/jilan/public_html/protected/views/events/category.php(35)

23             $i++;
24                }
25              }
26              else {
27              $restv = mysqli_query($GLOBALS["mysqli_con"], "SELECT * FROM `category`");
28              while ($row = mysqli_fetch_array($restv)) {
29         echo '
30         <div class="col-xl-6 col-lg-12">
31         <a href="'.REDIRECT .'events/category?cat='.$row['pagename'].'"><h4> &raquo; '. $row['name'].'</h4></a>
32             </div>';
33             }
34              }
35              if($i==0)
36                echo " No results found !";
37             ?>
38         </div></div>
39         <div class="col-xl-4 col-lg-12">
40             <?php require_once dirname(__FILE__) . '/../layouts/right.php'; ?>
41         </div>
42     </div>
43 </section>

Stack Trace

#4
+
 /home3/jilan/public_html/protected/controllers/EventsController.php(67): CController->render("category")
62     
63     public function actionSearch() {
64         $this->render('search');
65     }
66        public function actionCategory() {
67         $this->render('category');
68     }
69       public function actionDisplay() {
70         $this->render('display');
71     }
72     
#17
+
 /home3/jilan/public_html/index.php(22): CApplication->run()
17     defined('YII_DEBUG') or define('YII_DEBUG', true);
18 // specify how many levels of call stack should be shown in each log message
19     defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 3);
20 
21     require_once($yii);
22     Yii::createWebApplication($config)->run();
23 }  
2026-03-10 23:54:00 Apache Yii Framework/1.1.10