please help solve this problem, Fatal error: Uncaught Error: Call to a member function query() on null - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Sunday, June 6, 2021

please help solve this problem, Fatal error: Uncaught Error: Call to a member function query() on null

please help me... Warning: Undefined variable $conn in C:\Users\ASUS\Documents\xammp\htdocs\intern\internstu\activity.php on line 51 and it said Fatal error: Uncaught Error: Call to a member function query() on null in C:\Users\ASUS\Documents\xammp\htdocs\intern\internstu\activity.php:51 Stack trace: #0 {main} thrown in C:\Users\ASUS\Documents\xammp\htdocs\intern\internstu\activity.php on line 51

This is my code

                        <tbody>
                        <?php
                        $act_query = $conn->query("SELECT * FROM `student_details`") or die($conn->error);
                        while($act_fetch = $act_query->fetch_array()){
                        ?>
                        <tr>
                            <td><?php echo $act_fetch['std_logbookActivite']?></td>
                            <td><?php echo "<label class = 'text-info'>".date("M d, Y", strtotime($act_fetch['std_logbookDate']))."</label>"?></td>
                            <td><center><a href = "edit_activity.php?detail_id=<?php echo $act_fetch['detail_id']?>" class = "btn btn-warning"><span class=  "glyphicon glyphicon-edit"></span> Update</a> <a href = "#" data-toggle = "modal" data-target = "#delete_activity" name = "<?php echo $act_fetch['detail_id']?>" class = "btn btn-danger detail_id"><span class=  "glyphicon glyphicon-trash"></span> Delete</a></center></td>
                        </tr>
                        <?php
                            }
                        ?>
                        
                        </tbody>


source https://stackoverflow.com/questions/67852895/please-help-solve-this-problem-fatal-error-uncaught-error-call-to-a-member-fu

No comments:

Post a Comment