I have search stackoverflow about this issue. Even though looks like there are many questions about the topic, non of them solve my problem. I'm having a fetch_assoc() non-object error. I'm utilizing MySQLi and PHP 5.2. I don't have the option to change that. Here is the php code that I wrote that is getting me the error.
<?php
include '_includes/db.php';
$faculty_id = trim($_GET['faculty_id']);
$message = '';
include '_includes/connection.php';
if ($db->connect_error) {
$message = $db->connect_error;
} else {
$sql = "SELECT * FROM faculty WHERE faculty_id = $faculty_id";
$result = $db->query($sql);
$row = $result->fetch_assoc();
if ($db->error) {
$message = $db->error;
}
}
Any idea why this is happening?