How about: $content="line1\r\nline2" ??
Printable View
How about: $content="line1\r\nline2" ??
I added Pipes:
$content="line1\r\nline2" ;
print "<br>|".$content."| ";
and the Result is:
|line1 line2|
You need to try these strings in your query, not print them out.Quote:
Originally Posted by Player1005
Which ones cause the query to fall over?PHP Code:$content = "line1\r\nline2"; /* custom stirng here */
fclose($fp);
if(!get_magic_quotes_gpc())
{ $fileName = addslashes($fileName); }
print $fileName;
print $fileSize;
print $fileType;
$query = "INSERT INTO file (filename, filesize, filetype, filecontent ) VALUES ('$fileName', '$fileSize', '$fileType', '$content')";
Now it looks as if the upload would have been succesful.
But how can I upload a file?
A character in the file is causing the query to fail, this could either be quotes or white space characters. Did you test your query with all those strings? Did any of them cause the query to fail?
Also, try printing the entier query before you execute it, find the exact location at which it fails and you will have the character which is cuasing the problem.