Page 1 of 1
how can i post and display the photograph using php and mysq
Posted: Mon Mar 08, 2004 11:07 pm
by softsolvers
dear friends
i like to display a photograph in the my web page wich can be stored in the database can u suggest me how can i do this
Posted: Mon Mar 08, 2004 11:18 pm
by PrObLeM
Code: Select all
$dBHost = "*****";
$dbUser = "*****";
$dbPass = "*****";
$dbDatabase = "*****";
$db_connection = mysql_connect($dbHost, $dbUser, $dbPass) or die("Could not connect to DB");
mysql_select_db($dbDatabase, $db_connection) or die ("Could not find DB");
$result = mysql_query("SELECT img_location FROM database WHERE id='$id'");
$row = mysql_fetch_object($result);
print "<img src="".$row->img_location."">";
Posted: Mon Mar 08, 2004 11:52 pm
by softsolvers
Thanks but i want to upload the file in one page and then display the image when needed.So if u please suggest me the process and the way i shoul proceed.
Thanks
Posted: Tue Mar 09, 2004 12:01 am
by PrObLeM
ok
heres the process
1. upload
2. get filename
3. insert filename into db
4 when you want to display the image just use the db to get the filename
5.
6.profit
Posted: Tue Mar 09, 2004 12:10 am
by softsolvers
Hey Man,
i know such processes , my problem is concerned to get that very coding which is needed to get this. is there any specific function used to upload the file. just get me aware with only these things and please don't beat in the bush
softsolvers
Posted: Tue Mar 09, 2004 12:15 am
by PrObLeM
Posted: Tue Mar 09, 2004 3:26 am
by twigletmac
softsolvers wrote:Hey Man,
i know such processes , my problem is concerned to get that very coding which is needed to get this. is there any specific function used to upload the file. just get me aware with only these things and please don't beat in the bush
softsolvers
You are aware that this is not a script-writing service - if you want someone to write code for you please post in the Project Help Wanted/Volunteer Work Forum - the PHP - Code forum is for helping people who have at least attempted to do the work themselves.
Mac
Posted: Tue Mar 09, 2004 4:11 am
by softsolvers
i need to solve this prob as soon as possible, so plz. send me thesanpshot of the code that how could i first store the image in the database and then how i could access the image on the page,plz do help me?????
Posted: Tue Mar 09, 2004 4:22 am
by twigletmac
Make an attempt yourself to answer your question, search the web and this forum, you are asking something that others have already found the answer to, stop being lazy. You must make some attempt - we are not here to do your work for you.
Mac
Posted: Tue Mar 09, 2004 10:13 am
by Steveo31
Well said. I don't mean to stir the pot, but it looks like you are new, so I guess this is a warning.
Here's a more direct link that may help you in your quest.
http://us4.php.net/features.file-upload
Posted: Tue Mar 09, 2004 10:22 am
by infolock
moved to help wanted
Posted: Thu Mar 11, 2004 10:21 pm
by softsolvers
hello friends
Had you forgot ,i still facing problem i had searched on net but i am not getting the proper site from where i can get the solution will u plz. help me plz send me the place from where i got help or send me the snap of the code.
Looikng for post
Softsolvers
how to post and display the photograph using php and mysq
Posted: Thu Mar 11, 2004 10:24 pm
by softsolvers
hello friends
Had you forgot ,i still facing problem i had searched on net but i am not getting the proper site from where i can get the solution will u plz. help me plz send me the place from where i got help or send me the snap of the code.
Looikng for post
Softsolvers
_________________
Posted: Thu Mar 11, 2004 10:49 pm
by Steveo31
Code: Select all
<form enctype="multipart/form-data" action="_URL_" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
Look 4 posts up, then the second post in this thread....
Posted: Fri Mar 12, 2004 12:24 am
by softsolvers
Thanks,but i am telling you my actual requirement.i am making a site,in which i need to display image,for this on one page i like to give a button browse to choose the path of image and then store the image from that path to database,and on the next page i want to see that image,which fields i should take in mysql table,i am a new for php so plz. help me