I have a MySQL field ("imagelocation") that contains the relative pathname to an image. Essentially the construct: "DirectoryName/ImageName.png" The "/" is causing a problem. I get the error message: "Unknown column 'Analog' in 'field list'" (Analog is the name of the directory.)
Prior to building the pathname, the following code is executed to return only a "clean" image name.
$imagelocation=trim(SanitizeString($_FILES['imagevar']['name']));
The pathname is built with the following code:
$imagelocation=trim($magazinedirectory . "/" . $imagelocation);
The query to be executed:
$query="INSERT INTO tblIssueList(IssueDate,MagazineNUM,CoverArtistNUM,ImageLocation)" .
" VALUES({$issuedate},{$magazineidnum},{$artistidnum},{$imagelocation})";
The query works when "imagelocation" is removed. The query also works with "imagelocation" when the "/" is removed.
How can the relative pathname be stored in the field "imagelocation"?