I am trying to insert a data to a table but I am getting this frustrating error that I couldn't figure what is wrong. The error is as below:
Fatal error: Call to a member function bind_param() on a non-object
I have read it means prepare is returning false.. Here is the code where the error is occuring
$insert = $mysqli->prepare("insert into `hm_desktop`(`username`, `title`, `condition`, `description`, `price`, `brand`, `color`, `hard_drive_capacity`, `others`, `graphics_card`, `ram_capacity`, `operating_system`, `os_edition,` `processor_type`, `processor_speed`, `model`, `product_series`, `included_items`, `country`, image_one, image_two, image_three, image_four, image_five, `date`) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
$insert->bind_param('sssssssssssssssssssss', $username, $title, $cond, $desc, $price, $brand, $color, $hard_drive_type, $others, $garphics_card, $ram_capacity, $operating_system, $os_edition, $processor_type, $processor_speed,$model, $product_series, $included_items, $country, $random_name_generated, $i2, $i3, $i4, $i5, $date);
$insert->execute();
I have tried everything I could for hours but nothing seems to be working.. What am I missing here? please help