What I am trying to do is get the values of the $r variable (returns some vehicle id values) to display on the page. However it returns the following error.
Recoverable fatal error: Object of class mysqli_result could not be converted to string in C:\xampp\htdocs\SAMADHI\system\moduleeservation\controllereservationcontroller.php on line 166
The problem is on the echo $r
statement. I tried echo '$r' but then it shows nothing even though it displays the the message 'vehicle available'.
if ($nor > 0) {
$r = $objs->searchVehicle($vhandover, $vreturn, $seatcap);
if ($r) {
$msg = "Vehicle available";
$status = 1;
echo $r;
} else {
$msg = "Something is not right!";
$status = 0;
}
}
What am I doing wrong here and how can I correct it?
Thanks in advance :)