Can not figure out why this is not working. Have gone through other questions here, but it seems my code is fine.
$queryLink = $mysqli->prepare("SELECT vendor_name FROM vendors WHERE vendor_id='1'");
$queryLink->execute();
$queryLink->store_result;
$queryLink->bind_result($vendor_name);
$queryLink->fetch();
$numRows = $queryLink->num_rows;
$queryLink->close();
echo $vendor_name.'<br>'.$numRows;
The script returns this:
VendorNameHere
0
It is returning 1 record, but $numRows always stays 0. I have tried moving the numRows line to different places in the script, but it always returns 0. What am I doing wrong?