insertion and retrieval of piture file
Posted: Fri Feb 14, 2003 11:08 am
Hello every body
I am seeking your help. Hope I will get.
Here is the scenario:
I have a mediumblob data type in mysql (3.23.54).
The portion of the form that takes the picture (jpg) like this :-
<form enctype="multipart/form-data" method="POST" action="Add_Edit_Teacher.php">
………………………………………………………………………………………………
………………………………………………………………………………………………
<input type="hidden" name="MAX_FILE_SIZE" value="900000">
<input type="file" name="pic_file" >
………………………………………………………………………………………………
………………………………………………………………………………………………
</form>
I need to insert the picture into the database and retrieve and show it in another page.
For insertion I have proceeded up to this point in Add_Edit_Teacher.php file: -
(Using PHP 4.3 with register_globals default off)
if ($_POST['submit'])
{
$db=mysql_connect("localhost","root","");
mysql_select_db("iict_student",$db);
if (is_uploaded_file($_FILES['pic_file']['tmp_name']))
copy($_FILES['pic_file']['tmp_name'], "c:\\".$_FILES['pic_file']['name']);
This has been OK. After submitting I got the picture in c:\
Now please help me 1) for insertion how I will proceed and 2) to retrieve and show the picture in another page what I will do?
Waiting for your reply.
Thank you in advance.
___ZIA
I am seeking your help. Hope I will get.
Here is the scenario:
I have a mediumblob data type in mysql (3.23.54).
The portion of the form that takes the picture (jpg) like this :-
<form enctype="multipart/form-data" method="POST" action="Add_Edit_Teacher.php">
………………………………………………………………………………………………
………………………………………………………………………………………………
<input type="hidden" name="MAX_FILE_SIZE" value="900000">
<input type="file" name="pic_file" >
………………………………………………………………………………………………
………………………………………………………………………………………………
</form>
I need to insert the picture into the database and retrieve and show it in another page.
For insertion I have proceeded up to this point in Add_Edit_Teacher.php file: -
(Using PHP 4.3 with register_globals default off)
if ($_POST['submit'])
{
$db=mysql_connect("localhost","root","");
mysql_select_db("iict_student",$db);
if (is_uploaded_file($_FILES['pic_file']['tmp_name']))
copy($_FILES['pic_file']['tmp_name'], "c:\\".$_FILES['pic_file']['name']);
This has been OK. After submitting I got the picture in c:\
Now please help me 1) for insertion how I will proceed and 2) to retrieve and show the picture in another page what I will do?
Waiting for your reply.
Thank you in advance.
___ZIA