My insert query is not working

This is my code

if (isset($_POST['submit'])) {
			$prod_photo = addslashes(file_get_contents($_FILES["prod_photo"]["tmp_name"]));
			$cb_values =  array($_POST['cb1'],$_POST['cb2']);
			$prod_inc = implode(",", $cb_values);
			$prod_name = mysqli_escape_string($mysqli,$_POST['prod_name']);
			$prod_desc = mysqli_escape_string($mysqli,$_POST['prod_desc']);
			$prod_cat = mysqli_escape_string($mysqli,$_POST['prod_cat']);

			$result=$mysqli->query("INSERT INTO product_tbl(prod_photo,prod_name,prod_desc,prod_cat,prod_inc) VALUES('$prod_photo','$prod_name','$prod_desc','$prod_cat','$prod_inc')");
			header("location:../admin/settings?d=products&tab=2");
		}

Good day!

Please diagnose the error of the query, such as in this article.

Good day.
There’s no error. Tbh that query on my localhost is perfectly working. But then, when I uploaded my website here it happens to not work.

We use MariaDB as database system, and syntax may be a bit different than traditional MySQL. Try several other combinations, not sure what to say. Simulate the INSERT command in phpmyadmin console.

I certify though that issue is not from our server.

This topic was automatically closed after 26 hours. New replies are no longer allowed.