With the php code below, I am trying to select a record from my database. When I run the code I get this error:
Catchable fatal error: Object of class mysqli_result could not be converted to string
What I want to achieve is to convert the result into a jSON object, but instead I get this error.
<?php
session_start();
include_once 'db/dbconnect.php';
$var = $_GET['name'];
// echo $var;
$json = [];
$sql = "SELECT * from recipes WHERE recipes.recipeName = '.$var'";
$rslt = mysqli_query($con,$sql);
echo $rslt;
?>