I'm fairly new to PHP. I have the following script:
The script mostly works ... It does insert a row into the MySQL database. All of the fields in that row appear except for the most important one -- the one with the file in it. Can anybody tell me what I'm doing wrong?
MrsBean
Code:
$fileUpload = "EXACT_PATH_TO_TEMPORARY_FOLDER_WHICH_I_KNOW_EXISTS/".$_REQUEST[fileUpload];
$fileHandle = fopen($fileUpload, "r");
$fileContent = fread($fileHandle, $fileUpload_size);
$fileContent = addslashes($fileContent);
$sConn = mysql_connect($dbServer, $dbUser, $dbPass)
or die("Couldn't connect to database server");
$dConn = mysql_select_db($dbDatabase, $sConn)
or die("Couldn't connect to database $dbDatabase");
$dbQuery = "INSERT INTO phForms VALUES ";
$dbQuery .= "(0, '$fileUpload_name', '$fileContent', '$file
Upload_type', '$fileUpload_size', '$strDesc')";
mysql_query($dbQuery) or die("Couldn't add file to database");
fclose($fileHandle);
The script mostly works ... It does insert a row into the MySQL database. All of the fields in that row appear except for the most important one -- the one with the file in it. Can anybody tell me what I'm doing wrong?
MrsBean