$fileinput = "C:\Documents and Settings\kmemis\My Documents\My Pictures\Sample.jpg";
Try a local file, stored near your PHP script :
MyProject\myphpscript.php
MyProject\images\Sample.jpg
You need reading rights to the folder. I'm not sure your access rights are properly set for the My Documents folder.
$image = @addslashes(fread(fopen($fileinput,"r"), 1000000));
Read previous remarks. It's unreadable, NEVER use 3 function calls on a line. You can't debug. fopen may fails, fread may fails... Moreover you actually hide all errors with @!
$SQL = @"INSERT INTO tablename (no,body) values (null, \"" . $image . "\")";
@ to a " ? Read the manual for more info about the @ operator. Use it before function, it should be before mysql_query, not the query string.
fread(fopen($fileinput,"r"), 1000000)
Use file () to read a whole file. This way you don't need to specify that "stupid" number of bytes thing.
$SQL = @"INSERT INTO tablename (no,body) values (null, \"" . $image . "\")";
Replace \" by ', it's easier to debug and read.
Read the whole post again and pay attention to our remarks, specially the one by
jerdo !
Hope it helps π
JM