Hello all i am a newbie and i would love to learn from you all. Please help me as i am making a project with phpmysqli where i need to approve a pending status! Here's my code. Kindly help me thanks.

// Collecting data from query string
// Checking data it is a number or not
echo "Data Error";
// MySQL connection string
require "dbconfig.php"; 

$count="SELECT * FROM createnearmiss where id=?";

if($stmt = $connection->prepare($count)){

 $result = $stmt->get_result();

 echo "<table>";
echo "

   <table> <tr> <th>Details :</th> <td>$row->details</td> </tr> <tr> <th>Location :</th> <td>$row->location</td> </tr> <tr> <th>Date :</th> <td>$row->date</td> </tr> <tr> <th>Time :</th> <td>$row->time</td> </tr> <tr> <th>Checkbox :</th> <td>$row->checkbox</td> </tr> <tr> <th>Name :</th> <td>$row->name</td> </tr> <tr> <th>Employeeid :</th> <td>$row->employeeid</td> </tr> <tr> <th>Age :</th> <td>$row->age</td> </tr> <tr> <th>Department :</th> <td>$row->department</td> </tr> <tr> <th>Contact :</th> <td>$row->contact</td> </tr> <tr> <th>Organization :</th> <td>$row->organization</td> </tr> <tr> <th>Summary :</th> <td>$row->summary</td> </tr> <tr> <th>Images :</th> <td>$row->images</td> </tr> <tr> <th>Outcome :</th> <td>$row->outcome</td> </tr> <tr> <th>Cause :</th> <td>$row->cause</td> </tr> <tr> <th>Action :</th> <td>$row->action</td> </tr> <tr> <th>Reportedby :</th> <td>$row->reportedbyname</td> </tr> <tr> <th>Position :</th> <td>$row->position</td> </tr> <tr> <th>Organisation :</th> <td>$row->reportedorganisation</td> </tr> <tr> <th>Reportedcontact :</th> <td>$row->reportedcontact</td> </tr> <tr> <th>Status :</th> <td>$row->status</td> </tr> </table>


echo "</table>";
echo $connection->error;
?> <form action='' method='post'> <input type='submit' value='Approved' name='status1'> <input type='submit' value='Rejected' name='status2'> </form> <?php
include 'dbconfig.php';

    mysqli_query($link,"update createnearmiss set status='$_POST[status1]'");

Why are you mixing the OOP variant of mysqli on lines 15-21 with the procedural variant on line 38 ??

commented: i get it now but if you have time can you please show me oop version for updating the coloumn? variant +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.