0

Hi I am getting this error but couldn't figure out what's wrong with it.

    $ID= $_SESSION['ID'];
ImageUpload($ID, 0, $IN, $Cmnt,$lll);
    $sql="INSERT INTO `Image` (`ID`, `Img_ID`,`Img_Name`,`Comment`,`Likes`) VALUES (`$ID`,`$Img_ID`,`$IN`,`$Cmnt`,`$lll`); ";
    if($conn->query($sql)==TRUE){}else{ echo "Error".$sql."<br>".$conn->error;}
    $conn->close();

imageupload function:

function ImageUpload($ID1, $Img_ID1, $Img_Name1, $Comment1,$Likes1)
{
$GLOBALS['ID']=$ID1;
$GLOBALS['Img_ID']=$Img_ID1;
$GLOBALS['Img_Name']=$Img_Name1;
$GLOBALS['Comment']=$Comment1;
$GLOBALS['Likes']=$Likes1;
}

Error message that I get; (Img_ID will be auto incremented)

INSERT INTO `Image` (`ID`, `Img_ID`,`Img_Name`,`Comment`,`Likes`) VALUES (`1`,`0`,`1631109658.jpg`,`trytrytry`,`0`); 
Unknown column '1' in 'field list'

What I have under the Image table : IDx|Img_ID|Img_Name|Comment|Likes

0 Answers0