Предупреждение: mysqli_stmt_bind_param () ожидает, что параметр 1 будет mysqli_stmt, boolean задан в

<?php if(isset($_POST['submit'])){ $data_missing = array(); if(empty($_POST['first_name'])){ // Adds name to array $data_missing[] = 'First Name'; } else { // Trim white space from the name and store the name $f_name = trim($_POST['first_name']); } if(empty($_POST['last_name'])){ // Adds name to array $data_missing[] = 'Last Name'; } else{ // Trim white space from the name and store the name $l_name = trim($_POST['last_name']); } if(empty($_POST['email'])){ // Adds name to array $data_missing[] = 'Email'; } else { // Trim white space from the name and store the name $email = trim($_POST['email']); } if(empty($_POST['birth_date'])){ // Adds name to array $data_missing[] = 'Birth Date'; } else { // Trim white space from the name and store the name $b_date = trim($_POST['birth_date']); } if(empty($_POST['sex'])){ // Adds name to array $data_missing[] = 'Sex'; } else { // Trim white space from the name and store the name $sex = trim($_POST['sex']); } if(empty($data_missing)){ require_once('database.php'); $query = "INSERT INTO etable (first_name, last_name, email, birth_date, sex) VALUES (?, ?, ?, ?, ?, ?)"; $stmt = mysqli_prepare($dbc, $query); mysqli_stmt_bind_param($stmt, "ssssss", $f_name, $l_name, $email, $b_date, $sex); mysqli_stmt_execute(); $affected_rows = mysqli_stmt_affected_rows(); if($affected_rows == 1){ echo 'Student Entered'; mysqli_stmt_close($stmt); mysqli_close($dbc); } else { echo 'Error Occurred<br />'; echo mysqli_error($dbc); mysqli_stmt_close($stmt); mysqli_close($dbc); } } else { echo 'You need to enter the following data<br />'; foreach($data_missing as $missing){ echo "$missing<br />"; } } } ?> 

Если вам задано boolean , это может указывать на то, что у вас плохой запрос mysqli_prepare . В твоем случае:

 $query = "INSERT INTO etable (first_name, last_name, email, birth_date, sex) VALUES (?, ?, ?, ?, ?, ?)"; 

Я вижу, что вы выбрали 5 столбцов, но написано 6 ? (параметры), что делает этот запрос недействительным.

Кстати, соединение также может вызвать проблемы. Конечно, вы можете написать:

 echo mysqli_connect_error(); 

Чтобы проверить, действительно ли ваше соединение.