I am getting following error from PHP and MYSQL, but the SQL statement is correct, I grabbed it direct from PHPmyadmin, I have included a picture from PHPMYADMIN showing the table.
$sql = 'SELECT * FROM company';
if ($mysqli->query($sql) === TRUE) {
$result = $mysqli->query($sql);
if ($result->num_rows > 0) {
(data from result's)
}
} else {
echo "Error: " . $sql . "<br>" . $mysqli->error;
exit();
}
Result: (There is nothing from $mysqli->error;)
Error: SELECT * FROM company
Inserted 2 rows into the table, still getting same error.
Removed the first if statement.
Now getting following error:
( ! ) Notice: Trying to get property of non-object in C:\xampp\htdocs\mkpenterprices\Research.php on line 248
Finally got the SQL to run but its not populating anything on the javascript section.