So I have this query that gives me an error about the mysqli_bind_param()
expects parameter 1 to be mysqli_stmt, boolean given
here is the query
$query = "INSERT INTO `users` (`user_name`, `password`, `first_name`, `last_name`) VALUES (?, ?, ?, ?)";
$stmt = mysqli_prepare($conn, $query);
mysqli_stmt_bind_param($stmt, 'ssss', $user_name, $pass, $first_name, $last_name);
mysqli_stmt_execute($stmt);
this is the code for my connection:
<?php
$mysql_error = 'Could not connect';
$mysql_host = 'localhost';
$mysql_user = 'root';
$mysql_pass = '';
$mysql_db = 'users';
$conn = @mysqli_connect($mysql_host, $mysql_user,$mysql_pass,$mysql_db) or die($mysql_error);
?>
EDIT:
This is the database name: users
This is the table name: user
this is the column names:
id
, user_name
, password
, first_name
, last_name