I’m just trying to select a specific row in the DB, but my result-set keeps coming up empty for some reason. However, when I run the query in HeidiSQL, I get results.
I’m stumped. I don’t see anything particularly wrong with my code, and I’ve tried echoing $mysqli->error, but I don’t have any errors. I have also added ini_set('display_errors', 'On'); error_reporting(E_ALL); to my code.
$id =$_GET['sysid'];
$system_info = $mysqli->prepare("SELECT * FROM systems WHERE systems.id = ?");
$system_info->bind_param("i", $id);
$system_info->execute();
$system_info->store_result();
$system_info->bind_result($system_id, $system_name, $system_img);
You need to
fetchthe results.Then you can use
$system_id,$system_nameand$system_img.store_resultwill return you amysqli_resultobject; it ignoresbind_result.