This question already has an answer here:
Im trying to store the results from my query into a variable but get this error
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, object given
$result = mysqli_query($con,"Select objectID from objects where objectName = '$_POST[relations]'");
if($result === FALSE) {
die(mysqli_error()); // TODO: better error handling
}
$result = mysql_fetch_assoc($result);
echo $result;
Any other way of storing this variable?
</div>