How to save picture in mysqlHow to save picture in mysql
Page 1 of 1
5 Replies - 34926 Views - Last Post: 19 February 2009 - 01:47 PM
#1
How to save picture in mysql
Posted 23 January 2008 - 01:52 AM
i need help in my project. i must save picture in mysql database.
Replies To: How to save picture in mysql
#2
Re: How to save picture in mysql
Posted 23 January 2008 - 09:35 AM
do you have to save pictures or couldnt you just save the image name into mysql and then when u pull the record from the database and would like to view the picture u basically put it in a image tage
i think its something along that lines i have the code and ill grab it for u shortly and repost but its something like that off the top of my head
dan
<img src="direct to the image folder/ $variable user to hold the sql return['imagename']" />
i think its something along that lines i have the code and ill grab it for u shortly and repost but its something like that off the top of my head
dan
#3
Re: How to save picture in mysql
Posted 23 January 2008 - 09:41 AM
$pic=$row['Picture']; ><img src='../images/$pic' border=0 alt=''></
thats how i have gone about using images with my database
hope that helps.
#4
Re: How to save picture in mysql
Posted 23 January 2008 - 11:04 PM
Alternative way, which I do not prefer :
- http://dev.mysql.com....0/en/blob.html
- http://www.weberdev....ample-3688.html
It's better to upload image in directory and put image path in MySQL field.
- http://dev.mysql.com....0/en/blob.html
- http://www.weberdev....ample-3688.html
It's better to upload image in directory and put image path in MySQL field.
#5
Re: How to save picture in mysql
Posted 19 February 2009 - 04:18 AM
mouse_catz00, on 23 Jan, 2008 - 12:52 AM, said:
i need help in my project. i must save picture in mysql database. 
hi mouse
it is hell of a mission to get the jpg data in and out of mysql successfully.
I eventualy uploaded the pics via ftp and inserted the location relative to location of my site.
just be careful it changes between linux and windows.
use this but change the variabls acording to you display page
<img src=<?php echo $row_Recordset1['image']; ?> width="320" height="240" />
linux: sqlentry would be "dir/filename.ext" if the display page is at the root of the site
windows: sqlentry would be "dir\filename.ext" if the display page is at the root of the site
hope this helps
#6
Re: How to save picture in mysql
Posted 19 February 2009 - 01:47 PM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|