Why am I getting an error with this code?
$stmt = $mysqli->prepare(
"INSERT INTO buku VALUES (
NULL,
(SELECT id_penerbit FROM penerbit WHERE nm_penerbit = ?),
(SELECT id_pengarang FROM pengarang WHERE nm_pengarang = ?),
(SELECT id_kategori FROM kategori WHERE nm_kategori = ?),
(SELECT id_lemari FROM lemari WHERE nm_lemari = ?),
?, ?, ?, ?, ?, 0, ?");
$stmt->bind_param("ssssssisss", $penerbit, $pengarang, $kategori, $lemari, $judul, $isbn, $hal, $terbit, $bahasa, $sinopsis);
if($stmt->execute()) showAlert("Berhasil mengubah kategori", "success");
else showAlert($stmt->error);
The error I'm getting is:
Fatal error: Call to a member function bind_param() on a non-object in C:\xampp\htdocs\eperpus\admin\buku-tambah.php on line 34