when i trying to get values the above error is displaying
<?php
session_start();
include("connectdb.php");
if( isset( $_POST['id'])) {
$id = $_POST['id'];
}
$query = "SELECT * from approvedelectricity where id` = '$id';";
$result= mysqli_query($conn, $query);
if(mysqli_num_rows($result)>0){
while($row = mysqli_fetch_array($result))
$rows[] = $row;
foreach($rows as $i){
if($i['message']=='approved'){
echo " liked your post";
}else{
echo "rejected";
}
}
}
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
mysqli_close($conn);
?><br/><a href="index.php">BACK</a>
What I have tried:
i need to display message apporved if message is approved