I'm probably just too tired, and looking over a small error, but this code will not input any information into my database.
$sql = "INSERT INTO TABLE_NAME (UPC, Description, Make, Model, SNLocation, IMEI_MEID, Resetting, Notes, Image)
VALUES ($UPC, $Desc, $Make, $Model, $SNLocation, $IMEI_MEID, $Resetting, $Notes, $Image)";
mysqli_query($con, $sql) or die(mysqli_error($sql));
Could someone help me check if this has syntax issues or something?
Its because you had an error
$sql = "INSERT INTO TABLE_NAME (UPC, Description, Make, Model, SNLocation, IMEI_MEID, Resetting, Notes, Image)
VALUES ('$UPC', '$Desc', '$Make', '$Model', '$SNLocation', '$IMEI_MEID', '$Resetting', '$Notes', '$Image')";
removed ] from Notes, Image)]
<-----
and values need to be quoted
You need to remove ]
and enclose string values with single quotes('
) :
$sql = "INSERT INTO TABLE_NAME
(UPC, Description, Make, Model,
SNLocation, IMEI_MEID, Resetting, Notes, Image)] <-- Here -->
VALUES ($UPC, $Desc, $Make, $Model, $SNLocation, $IMEI_MEID, $Resetting, $Notes, $Image)";
mysqli_query($con, $sql) or die(mysqli_error($sql));