Insert returning null and no error message from the script


it has something to do with my is it.

$sql=“INSERT INTO property (property_name, property_location, property_price, category_id, status)VALUES (?, ?, ?, ?, ?)”;

  	     $params=[$property_name, $property_location, $property_price, 
					$category_id, $status];

						echo "good";
					else { echo "bad";}


That’s the same code that you put above, and $insert will always be null because your runQuery() function does not return a value, whether the query worked or not. So you must return a value to be able to decide whether the query worked or did not work.


thanks it’s working now. i appreciate all your effort.