Hi,
I am trying to copy a file into a database, i am using the following code
echo $_FILES['cv']['size'];
$file = addslashes(fread(fopen($_FILES['cv']['tmp_name'],"r"), $_FILES['cv']['size']));
$file = base64_encode($file);
mysql_connect(localhost,"***","***");
@mysql_select_db("xxxx") or die( "Unable to select database");
$query = "INSERT INTO employees VALUES ('',$sal ,$fullname, $address1,$address2, $jobtype, $other,$email, $commnets,'cv',$username,$password)";
$query = "INSERT INTO employees VALUES ('','$sal' ,'$name','$address1','$address2', '$jobtype', '$other','$email' ,'$phone', '$comments','$file','$username','$password')";
[code=php]
but i get the following message
Warning: fopen(smtp1.zip): failed to open stream: No such file or directory in /home/httpd/vhosts/httpdocs/php/register2.php3 on line 38
Warning: fread(): supplied argument is not a valid stream resource in /home/httpd/vhosts/httpdocs/php/register2.php3 on line 38
done
am i doing something very silly?
thanks