mercredi 1 avril 2020

How to solve Fatal error: Uncaught Error: Call to a member function bind_param() on boolean?

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
try{
  require('../common/Connection.php');

  $query= "insert into products values(?,?,?,?,?,?,?,?,?,?)";
  $stmt = $conn->prepare($query);

  $stmt->bind_param("ssssssssss", 
  $pid,$pname,$cname,$iname1,$iname2,$iname3,$iname4,$pprice,$pmaterial,$pkeywords);

  $pid = mysqli_real_escape_string($conn,$_POST['pidh']);
  echo '1 parameters passed successfully' ;
  $pname = $_POST['pname'];
  $cname = $_POST['cname'];
  echo '3 parameters passed successfully' ;
  .
  .
  // more code

One answer is telling that it occur due to incorrect sql query. but Connection is establishing and table name is correct . Same Function are working in anathor php page where categories are uploading but problem is in product upload




Aucun commentaire:

Enregistrer un commentaire