When this runs on my php page mysql returns an error "column image_data cannot be null". However, I can copy and paste the query from the output of 'echo $dbQuery' and run that directly on the mysql server and it accepts it with no problems.
I have also tried this without 'addslashes' but get the same error, this time on the mysql server as well.
any idea what is going on here?
the output of the echo statement is
INSERT INTO LIT_REQ_IMAGES (FILENAME, WIDTH, HEIGHT, MIME_TYPE, IMAGE_DATA) VALUES('testfile.png',171, 300,'image/png',LOAD_FILE('C:\\Inetpub\\vhosts\\mydomain.net\\httpdocs\\lit_request\\upload\\testfile.png'))
The path and file are valid (as I said this works fine when the query is run on the server.)
I have also tried this without 'addslashes' but get the same error, this time on the mysql server as well.
Code:
$fullPath = addslashes(realpath('upload/' . $image));
$dbQuery = "INSERT INTO LIT_REQ_IMAGES (FILENAME, WIDTH, HEIGHT, MIME_TYPE, IMAGE_DATA) VALUES('$image',$newWidth, $newHeight,'$imageMimeType',LOAD_FILE('$fullPath'))";
echo $dbQuery;
mysql_query($dbQuery);
echo mysql_error();
any idea what is going on here?
the output of the echo statement is
INSERT INTO LIT_REQ_IMAGES (FILENAME, WIDTH, HEIGHT, MIME_TYPE, IMAGE_DATA) VALUES('testfile.png',171, 300,'image/png',LOAD_FILE('C:\\Inetpub\\vhosts\\mydomain.net\\httpdocs\\lit_request\\upload\\testfile.png'))
The path and file are valid (as I said this works fine when the query is run on the server.)