You are mixing
mysql
and
mysqli
. The line
$u = mysql_query($con, "INSERT productorders SET ID='".$ID."', ProductName='".$ProductName."', Price='".$Price."', Stock='".$Stock."'");
should be
$u = mysqli_query($con, "INSERT productorders SET ID='".$ID."', ProductName='".$ProductName."', Price='".$Price."', Stock='".$Stock."'");
You should also check the return value stored in the variable
$u
. If that is
FALSE
, the insert operation failed and you can get the error message by calling
mysqli_error($con)
.