Problem inserting an uploaded file into database
Posted: Thu Sep 25, 2003 2:08 pm
Hi
I am trying to insert an uploaded file into the database.
I found that it can be done with a query as below :
insert into tablename(blobfield) values(load_file('/path/to/file.txt'))
I am running the code from windows machine which uses unix server.
when I try to give in something like :
It gives me syntax / parse error on load_file()
Can anyone please help me out with this !!
Thanks in advance
I am trying to insert an uploaded file into the database.
I found that it can be done with a query as below :
insert into tablename(blobfield) values(load_file('/path/to/file.txt'))
I am running the code from windows machine which uses unix server.
when I try to give in something like :
Code: Select all
<?php
$main_query = "INSERT INTO submitted_material_list
(Application_Material_ID,
Application_ID,
Physical_Copy,
Rec_By,
Rec_Date)
VALUES ($app_mat_id,
$app_id,
load_file('check/$_FILES['userfile']['name']'),
$app_id,
SYSDATE)";
?>Can anyone please help me out with this !!
Thanks in advance