Dear Guys,
I'm very new in MySql,
I selected varchar for upload a picture, but when I set a query It doesn't show the picture and some times show me the path of picture not the picture exactly.
Thank you very much to help me.
Problems storing images in database
Page 1 of 18 Replies - 965 Views - Last Post: 25 January 2008 - 11:36 AM
Replies To: Problems storing images in database
#2
Re: Problems storing images in database
Posted 23 January 2008 - 06:43 PM
Dear guys,
I'm very new in MySql,
I selected varchar for upload a picture, but when I set a query It doesn't show the picture and some times show me the path of picture not the picture exactly.
Thank you very much to help me.
I'm very new in MySql,
I selected varchar for upload a picture, but when I set a query It doesn't show the picture and some times show me the path of picture not the picture exactly.
Thank you very much to help me.
#3
Re: Problems storing images in database
Posted 23 January 2008 - 06:58 PM
This is like the 4th time you posted this please be patient someone will get around to helping you. but to answer your question.
Try this:
Try this:
# # Table structure for table 'tblimage' # CREATE TABLE `tblimage` ( `imgid` int(3) unsigned NOT NULL auto_increment, `imgtype` varchar(16) NOT NULL default '', `imgdata` mediumblob, PRIMARY KEY (`imgid`) ) TYPE=MyISAM;
This post has been edited by nykc: 23 January 2008 - 06:59 PM
#4
Re: Problems storing images in database
Posted 23 January 2008 - 07:01 PM
nykc, on 23 Jan, 2008 - 06:58 PM, said:
This is like the 4th time you posted this, once is enough be patient. but to answer your question.
Try this:
Try this:
# # Table structure for table 'tblimage' # CREATE TABLE `tblimage` ( `imgid` int(3) unsigned NOT NULL auto_increment, `imgtype` varchar(16) NOT NULL default '', `imgdata` mediumblob, PRIMARY KEY (`imgid`) ) TYPE=MyISAM;
Thank you
sorry for send 3 times today is my first day and I am not familiar with this ways,
By the way I want to do it in php my admin not in code area, actually I've started to learn my sql 6 adys ago !!!!!!
#5
Re: Problems storing images in database
Posted 23 January 2008 - 07:03 PM
Thats even easier - just use Blob or mediumblob instead of varchar.
Hope that helps..
From personal experiences sometimes its better to call a URL from an image hosted on site than to actually insert image in database to restrict the load. Especially if this is going to be a large database.
Hope that helps..
From personal experiences sometimes its better to call a URL from an image hosted on site than to actually insert image in database to restrict the load. Especially if this is going to be a large database.
This post has been edited by nykc: 23 January 2008 - 07:04 PM
#6
Re: Problems storing images in database
Posted 23 January 2008 - 07:13 PM
nykc, on 23 Jan, 2008 - 07:03 PM, said:
Thats even easier - just use Blob or mediumblob instead of varchar.
Hope that helps..
From personal experiences sometimes its better to call a URL from an image hosted on site than to actually insert image in database to restrict the load. Especially if this is going to be a large database.
Hope that helps..
From personal experiences sometimes its better to call a URL from an image hosted on site than to actually insert image in database to restrict the load. Especially if this is going to be a large database.
Thank you,
I'll try and let you know.
#7
Re: Problems storing images in database
Posted 23 January 2008 - 07:14 PM
kia_hm, on 23 Jan, 2008 - 09:13 PM, said:
nykc, on 23 Jan, 2008 - 07:03 PM, said:
Thats even easier - just use Blob or mediumblob instead of varchar.
Hope that helps..
From personal experiences sometimes its better to call a URL from an image hosted on site than to actually insert image in database to restrict the load. Especially if this is going to be a large database.
Hope that helps..
From personal experiences sometimes its better to call a URL from an image hosted on site than to actually insert image in database to restrict the load. Especially if this is going to be a large database.
Thank you,
I'll try and let you know.
You are welcome.
Good luck
#8
Re: Problems storing images in database
Posted 25 January 2008 - 08:48 AM
I wasn't aware mySQL had a varchar data type, I thought that was specific to Microsoft SQL Server, besides that, if you're storing images as varchar you're not saving anything, at best you're just saving the path to the image (as an image cannot be converted to varchar).
Besides, its very inefficient to store the actual image in the database, store the image on your server and just the path and relavent information about the image in the database. Storing the actual image means there has to be a server call for each image that is to load on every page, not a good use of system resources if you ask me
Besides, its very inefficient to store the actual image in the database, store the image on your server and just the path and relavent information about the image in the database. Storing the actual image means there has to be a server call for each image that is to load on every page, not a good use of system resources if you ask me
#9
Re: Problems storing images in database
Posted 25 January 2008 - 11:36 AM
PsychoCoder, on 25 Jan, 2008 - 10:48 AM, said:
I wasn't aware mySQL had a varchar data type, I thought that was specific to Microsoft SQL Server, besides that, if you're storing images as varchar you're not saving anything, at best you're just saving the path to the image (as an image cannot be converted to varchar).
No they have Varchar.
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|