mysqli :: query (): не удалось получить mysqli
Предупреждение: mysqli :: query (): Couldn 'получить mysqli в C: \ Program Files (x86) \ EasyPHP-DevServer-13.1VC9 \ data \ localweb \ мои переносимые файлы \ class_EventCalendar.php в строке 43
Вот мой файл подключения:
connect_errno) {
// Add error to errors array
$ErrorMsgs[]="The database server is not available.".
" Connect Error is ".$DBConnect->connect_errno." ".
$DBConnect->connect_error.".";
}
?>
Это мой класс: я
DBConnect = $DBConnect;
}
function __destruct() {
if (!$this->DBConnect->connect_error) {
$this->DBConnect->close();
}
}
function __wakeup() {
// Include the database connection data
include("inc_LadleDB.php");
$this->DBConnect = $DBConnect;
}
// Function to add events to Zodiac calendar
public function addEvent($Date, $Title, $Description) {
// Check to see if the required fields of Date and Title have been entered
if ((!empty($Date)) && (!empty($Title))) {
/* if all fields are complete then they are
inserted into the Zodiac event_calendar table */
$SQLString = "INSERT INTO tblSignUps".
" (EventDate, Title, Description) ".
" VALUES('$Date', '$Title', '".
$Description."')";
// Store query results in a variable
$QueryResult = $this->DBConnect->query($SQLString);
я не очень хорош с ООП PHP и яЯ не уверен, почему эта ошибка возникает. Я вытащил этот код из другого места, и единственное, что я изменил, было@new mysqli
параметры. Может ли кто-нибудь помочь мне понять, что происходит не так?