:glare: I am getting this error on every one of my scripts:
Fatal error: Call to a member function execute() on a non-object in /Library/WebServer/Documents/DispatchReports/InTime.php on line 55
The offending code is:
$host="localhost";
$user="root";
$password="g1G3m#1989";
$Dbname = "CallsToDispatch";
$mysqli = new mysqli($host, $user, $password, $Dbname) or die('host doesnt work ' . $mysqli->error);
// Check connection
if ($mysqli->connect_errno) {
echo "Hey you dolt, Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
///////no good
$Quest = "SELECT WorkDate FROM InTime";
$stmt = $mysqli->prepare($Quest);
$stmt->execute(); // <- error happens here
$DateResult = $stmt->get_result();
$TestWorkDate = $row['WorkDate'];
echo $TestWorkDate . ' a ' . $WorkDate . '<br>';
ini_set('auto_detect_line_endings', true);
Everything was good at 5:00 yesterday. Why now?