I'm trying to query a database using php5.6, I can't get this query to work, the error seems to be with
$response = @mysqli_query($dbc, $query) OR die('nope'. mysql_error());
This is my query php file:
<?php
require 'db.php';
$query = "SELECT * FROM USERS";
$response = @mysqli_query($dbc, $query) OR die('nope'. mysql_error());
if ($response){
echo 'Query successful!';
} else {
echo 'Error - query unsuccessful';
}
?>
This is my db connection file:
<?php
error_reporting(E_ALL);
$DB_User = 'user';
$DB_Passwd = 'pass';
$DB_Host = 'localhost';
$DB_Name = 'myDB';
$dbc = mysqli_connect($DB_Host,$DB_User,$DB_Passwd,$DB_Name);
if (!$dbc) {
die('Could not connect: ' . mysqli_error());
}
I've updated the files to all use mysqli and removed the @, but it's still not connecting or showing errors, still just throwing a 500. I'm not sure where to go from here...