How can i store jpegcam snapshots in mysql using php

I am using wampserver 2.2 on window 7 64 bit machine. I am using jpegcam to take snapshots and it works fine. I make upload folder within jpegcam/htdocs/upload to store snapshots. All works fine but how can i store uploaded images into mysql. I also want to retrieve image from mysql and print in php page.
The problem is jpegcam used java script in form in which POST method and type file was not used. I know perfectly that how to upload images to folder and store it into mysql using POST an $_FILES varibales .
here the code of in jpegcam/htocs/test.html
<form name=“f1” enctype=“multipart/form-data” method=“” action=“” >
<input type=button value=“Configure…” onClick=“webcam.configure()”>

 &lt;!--	 &lt;input type=button name="img" value="Take Snapshot" onClick="take_snapshot()"&gt;  --&gt;
 	&lt;a   href="javascript:void(webcam.freeze())"&gt;Freeze&lt;/a&gt;
 	&lt;a  href="javascript:void(webcam.upload())"&gt;Upload&lt;/a&gt;
  	&lt;a  href="javascript:void(webcam.reset())"&gt;Reset&lt;/a&gt;

and this the code of jpegcam/htocs/test.php

$target = ‘upload/’;
$filename = $target . date(‘YmdHis’) . ‘.jpg’;

$result = file_put_contents( $filename, file_get_contents(‘php://input’) );
if (!$result) {
print "ERROR: Failed to write data to $filename, check permissions
Now please tell me how can i store snapshots in mysql an retrieve it an print it in another php page.plz plzplz help me as soon as possibe. plz plz…
Thanks in