Hello guys... need your help...
First of all let me give you some information for the database...
CREATE TABLE pictures (
pic_id INT(5) NOT NULL AUTO_INCREMENT PRIMARY KEY,
play_id INT(5) NOT NULL,
pic_data LONGBLOB,
filename CHAR(50),
filesize CHAR(50),
filetype CHAR(50)
)
now... i am trying to insert the play_id and the pic_data into the database...
here is the form code:
<form action=insertpic.php3 method=post name=frm enctype=multipart/form-data>
<input type=hidden name=name value=picture>
<INPUT TYPE=hidden name=MAX_FILE_SIZE value=90000>
<input type=text name=field4 class=inp1>
<input type=file name=form_data class=inp1>
<input type=submit value=Submit class=inp2>
now... within the inserpic.php3 you can find:
function insertpic ($val1, $val2) {
$data = addslashes(fread(fopen($val2, "r"), filesize($val2)));
$sqlinsertpic ="INSERT INTO pictures (play_id, pic_data, filename, filesize,filetype) VALUES ('$val1','$data','$form_data_name','$form_data_size','$form_data_type')";
$new = @mysql_db_query($dbname, $sqlinsertpic);
}
insertpic ($field4, $form_data);
With that method i am able to insert the play_id and the pic_data into the database but i dont get the filename, the filesize and the filetype...
Could someone help me please?
Kind Regards
George