Reply to Re: [PHP] PHP Memory limit exceeded

Your name:

Reply:


Posted by Richard Lynch on 10/04/24 11:07

Ben-Nes Yonatan wrote:
> $data = "INSERT INTO test_files (bin_data, filename, filesize, filetype)
> VALUES ('$data', '$imagefile[name]', '$imagefile[size]',
> '$imagefile[type]')"; // creating the sql for the insert, i called the
> received value also $data cause i dont want to keep the previous $data
> (after all we want to save our precious memory no? :))
> echo memory_get_usage().'<br />'; // 5570400 memory bytes allocated
> {changed from b4 only alittle}

As noted, *DURING* the execution of this assignment statment, PHP has to
store $data in 2 places.

On a completely un-related topic, you should research the pros and cons of
storing image data directly in your database, if you haven't already.

MOST experts will tell you "don't do that" unless you have a very specific
performance maintenance requirement for it.

There is a highly-tuned long-established custom database engine
specifically geared for storing/maintaining/retrieve large binary data
like your images...

It's call "The File System" :-)

--
Like Music?
http://l-i-e.com/artists.htm

[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

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