Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
save image file into SQL server database
Old 02-07-2010, 05:33 PM save image file into SQL server database
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
HI


I been saving image file and label txt into SQL server database with binary mode, uploading from any images source .

Is there a better and a fast way script to do it?

Thanks
josil is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-07-2010, 05:46 PM Re: save image file into SQL server database
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yep...

... Don't!

Storing images (and retrieving them) as BLOBs is a resource intesive process and will slow down the site dramatically and/or increase the resource usage.
If it is a shared server or a VPS it could cause problems.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-07-2010, 06:04 PM Re: save image file into SQL server database
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Yep...

... Don't!

Storing images (and retrieving them) as BLOBs is a resource intesive process and will slow down the site dramatically and/or increase the resource usage.
If it is a shared server or a VPS it could cause problems.
Thanks.

Bu it will work if the website will have more then 100.000 image files?
josil is offline
Reply With Quote
View Public Profile
 
Old 02-07-2010, 06:12 PM Re: save image file into SQL server database
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Will what work?

It's not the amount of the images that matters, it's the processor time it takes in reading the BLOB then streaming the binary data to the browser.

If you simply store the path (physical or relative) in the database then the image data is read directly from the server HD.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-07-2010, 07:04 PM Re: save image file into SQL server database
Super Talker

Posts: 128
Name: Jose daSilva
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Will what work?

It's not the amount of the images that matters, it's the processor time it takes in reading the BLOB then streaming the binary data to the browser.

If you simply store the path (physical or relative) in the database then the image data is read directly from the server HD.
Dou you think I shoul have a separated HD just for the images folder and images database?
josil is offline
Reply With Quote
View Public Profile
 
Old 02-07-2010, 07:37 PM Re: save image file into SQL server database
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
You can if you want, but this is not necessary.
Just put the pictures in a predefined folder (and rename them, to be sure that no conflict arise) and store that picture name in your db.
Then, when you want to serve it back, pick the right picture from the folder, using the name in the db.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 07-21-2010, 04:32 AM Re: save image file into SQL server database
Junior Talker

Posts: 1
Trades: 0
Hi,

I am new to programmin in general and wonder if any of you can help me. I am trying to make a dynamic website, using mySQL, PHP and Dreamweaver CS4. I have the database roughly created and have login/logout, update/addand delete pages all sorted. What is giving me a headache is how to display images from an SQL query. I have the images in a \images folder, but I am not sure the correct syntax to store the img file path in the database. Also, I am not sure how to write the query that will look in the database for the filepath, and then display the image. Any help would be greatly appreciated

this is in reply to:
"If you simply store the path (physical or relative) in the database then the image data is read directly from the server HD."

James
JimiT is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to save image file into SQL server database
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.31926 seconds with 12 queries