$mysqli = new mysqli('localhost', 'root', '', 'cars123');
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
// prepare and bind
/*<?php ?> $start_date=$_POST['start_date'];
$end_date=$_POST['end_date'];
$cars=$_POST['cars'];
$Location_of_renting=$_POST['Location_of_renting'];
$Location_of_returning=$_POST['Location_of_returning'];
<?php ?>*/
global $connect;
$stmt = $mysqli->prepare("INSERT INTO cars321 VALUES (?,?, ?, ?, ?, ?, ?, ?, ?)");
$stmt->bind_param('sssssssss', $id,$start_date, $end_date, $cars, $Location_of_renting,$Location_of_returning,$vr_uzi,$vr_vraca,$paid);
$start_date = '2018-09-20';
$end_date= '2018-09-21';
$cars = "1";
$Location_of_renting= '2018-09-16 13:50:27
';
$Location_of_returning= '2018-09-16 13:50:29
';
$vr_uzi= 'mostar';
$vr_vraca= 'modstar';
$paid= '1';
/* execute prepared statement */
$stmt->execute();
printf("%d Row inserted.\n", $stmt->affected_rows);
/* close statement and connection */
$stmt->close();
/* Clean up table CountryLanguage */
/* close connection */
$mysqli->close();
CREATE TABLE `cars321` (
`id` int(11) NOT NULL,
`start_date` date NOT NULL,
`end_date` date NOT NULL,
`cars` int(11) NOT NULL,
`Location_of_renting` text NOT NULL,
`Location_of_returning` text NOT NULL,
`vr_uzi` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`vr_vraca` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`paid` int(11) NOT NULL DEFAULT '1',
`price` int(11) NOT NULL,
`numberdays` int(11) NOT NULL,
`Numbers_of_cars` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Fatal error : Uncaught Error: Call to a member function bind_param() on boolean in C:\xampp\htdocs\carbooking3\16 y\korak1.php:28 Stack trace: #0 {main} thrown in C:\xampp\htdocs\carbooking3\16 y\korak1.php on line 28
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$stmt->bind_param('sssssssss', $id,$start_date, $end_date, $cars, $Location_of_renting,$Location_of_returning,$vr_uzi,$vr_vraca,$paid); line **28**