Reply to Re: Pictures in mySQL

Your name:

Reply:


Posted by Jerry Stuckle on 05/04/07 01:56

flamer die.spam@hotmail.com wrote:
> On May 2, 12:18 am, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> blessblessbl...@gmail.com wrote:
>>> Hey guys,
>>> I am creating a code out of bits and pieces I found in somebody else's
>>> code, so I am not entirely sure how it behaves.
>>> <IMG SRC="picture.php?ID=1029&THUMB=yes">
>>> picture.php:
>>> <?
>>> Header( "Content-type: image/jpg");
>>> $linkID = mysql_connect("host", "user", "password");
>>> mysql_select_db("database", $linkID);
>>> if(isset($_GET['ID'])){$ID=$_GET['ID'];}else{$ID=0;}
>>> $result=mysql_query("SELECT * FROM picture_base WHERE ID=$ID") or
>>> die("Can't perform Query");
>>> $row=mysql_fetch_object($result);
>>> if(isset( $_GET['THUMB']){echo $row->THUMB}else{echo $row->IMG;}
>>> ?>
>>> The script works and displays pictures properly so I am happy with it.
>>> Its small and simple enough, my question is if not every site is
>>> saving their pictures in databases there must be a reason why, yes?
>>> And if I load picture.php?ID=1029&THUMB=yes as opposed to picture.php?
>>> ID=1029, will the script still load through the full sized image (in
>>> the IMG collum) and will that effect my traffic?
>>> thank you
>> I've been storing everything from scanned documents to pictures in
>> databases for over 20 years. It works fine. And the larger the number
>> of images, the better it outperforms a file system.
>>
>> For instance - how many file systems do you know can manage 100K files
>> in a single directory? A RDB can easily handle 10M pictures. There's
>> no "stress" on the database. But it can be a lot of "stress" on a file
>> system.
>>
>
>
> You raised an interesting point here I am working on a project
> currently with around 10million photos, some folders have 20k+ photos
> in each, ranging from a few hundred kbs to 6mb each.. would you
> recommend using a database over files? Would MySQL be suitable?
>
> Flamer.
>

Yep, databases work well for this kind of thing, if they're structured
correctly. And MySQL will do a good job for you.

But you really should be asking this in comp.databases.mysql.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация