Uncaught Error: Call to a member function bind_param() on bool on line 58
58 строка это:
$stmt->bind_param("ssssssssssssssssss", $title, $description, $dir, $type, $date_select_1, $date_select_2, $date_select_3, $date_select_4, $date_cont_1, $date_cont_2, $date_select_1_time, $date_select_2_time, $date_select_3_time, $date_select_4_time, $date_cont_1_time, $date_cont_2_time, $title_eng, $discription_eng);
Полный код
<?php
require_once __DIR__ . '/dv-files/connect.php';
$basedir = '/assets/img/slider/current';
$base_name = basename($_FILES['slider-img-load']['name']);
$uploaddir = $_SERVER['DOCUMENT_ROOT'] . 'wp-content/themes/project-my/' . $basedir;
function uploadFile($base_name, $uploaddir)
{
if (isset($_FILES)) {
$uploadfile = $uploaddir . $base_name;
$upload = move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);
if (!$upload) {
print_r('Erorr uploading file');
}
}
}
uploadFile($base_name, $uploaddir);
function query_Event($base_name, $mysql, $basedir)
{
$title = addslashes($_POST['slider-title']);
$title_eng = addslashes($_POST['slider-title-en']);
$description = addslashes($_POST['slider-description']);
$discription_eng = addslashes($_POST['slider-description-en']);
$type = $_POST['slider-options'];
$date_select_1 = $_POST['slider-number-date'];
$date_select_1_time = $_POST['slider-event-time-f'];
$date_select_2 = $_POST['slider-number-date-second'];
$date_select_2_time = $_POST['slider-event-time-s'];
$date_select_3 = $_POST['slider-number-date-third'];
$date_select_3_time = $_POST['slider-event-time-t'];
$date_select_4 = $_POST['slider-number-date-four'];
$date_select_4_time = $_POST['slider-event-time-fo'];
$date_cont_1 = $_POST['slider-continious-date'];
$date_cont_1_time = $_POST['slider-event-continious-time-f'];
$date_cont_2 = $_POST['slider-end-date'];
$date_cont_2_time = $_POST['slider-event-continious-time-s'];
$dir = $basedir . $base_name;
$sql = "INSERT INTO `slider` (`title`, `description`, `link`, `type_event`, `date_select_1`, `date_select_2`, `date_select_3`, `date_select_4`, `date_cont_1`, `date_cont_2`, `date_select_1_time`, ` date_select_2_time`, ` date_select_3_time`, `date_select_4_time`, `date_cont_1_time`, `date_cont_2_time`, `title_en`, `description_en`) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
$stmt = $mysql->prepare($sql);
$stmt->bind_param("ssssssssssssssssss", $title, $description, $dir, $type, $date_select_1, $date_select_2, $date_select_3, $date_select_4, $date_cont_1, $date_cont_2, $date_select_1_time, $date_select_2_time, $date_select_3_time, $date_select_4_time, $date_cont_1_time, $date_cont_2_time, $title_eng, $discription_eng);
$stmt->execute();
}
query_Event($base_name, $mysql, $basedir);