Wrox Programmer Forums
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 24th, 2004, 06:25 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
Default Pictures

Hi
I have question:
How can i upload the pictures to the mysql server in windows

I know there are a lot of script out there (PHP), but i need to do it like when i create table in mysql
mysql>create table.... (I don't want to do it with php, do it with mysql)
and I aready know the blob way or put the name of the pictures in to mysql table (but the problem is blob is too slow)
is anybody knows how to do it?

Thank You
Best Regards
mani_he

 
Old September 25th, 2004, 04:36 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Any help
Thanks

 
Old September 27th, 2004, 09:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Moharo
Default

i think that using blobs in mysql is very inefficient and slow. the best way to do is to store just image source in mysql table...
 
Old September 27th, 2004, 12:14 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Thanks Moharo for your reply
So you mean just store the address of my image to mysql table, Right?

Thanks
Best Regards

 
Old October 20th, 2004, 12:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There's a pretty big debate about whether it's better to store the raw image data vs. a filename in the database. Personally, I prefer to store the path in the database, since it's generally the filename you need when generating the <img> tags in your HTML documents, not the actual binary image data.

One of the most frequently mentioned arguments FOR storing binary data in the database is that it makes it easier to migrate your site from one server to another. My response to that is that one generally doesn't migrate their sites all that often, and if they do, the extra effort is simply zipping up the filesystem that stores the images and extracting it on your new server. Usually this is pretty painless, so long as the paths you store in the database are relative. If you store an absolute path in your database, then yeah, it becomes more of a headache to convert these to match the absolute path on your new server. Still, this can be done with a really really really simple/short PHP script or database query.


Take care,

Nik
http://www.bigaction.org/
 
Old October 28th, 2004, 09:03 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 117
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Thanks
Your answer is really good and i will store the path in mysql instead of storing image.

Thanks
Regards






Similar Threads
Thread Thread Starter Forum Replies Last Post
Display many pictures NBM Java GUI 0 September 3rd, 2006 06:54 AM
Displaying pictures louie001 ASP.NET 1.0 and 1.1 Basics 2 November 24th, 2005 04:11 PM
Pictures on a report Corey Access 2 October 17th, 2005 10:53 AM
How to Scale Pictures down gmoney060 Classic ASP Basics 1 September 13th, 2004 06:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.