You are here: Re: putting a word doc in a mysql db? « PHP Programming Language « IT news, forums, messages
Re: putting a word doc in a mysql db?

Posted by monomaniac21 on 01/14/06 15:10

Robert Lummert wrote:
> Marc,
>
> you can put your binary data into a blob field (say named doc) using
> straight sql just like:
>
> $sql = 'update mytable set doc=0x';
> $fh = fopen($_FILES['userfile']['tmp_name'],'rb');
> while(true) {
> $chunk = unpack('H*chunk',fread($fh,512));
> $sql .= $chunk['chunk'];
> if(strlen($chunk['chunk'])<512) break;
> }
> fclose($fh);

Robert how do you then retrieve this data, as a word document that can
be opened right away?

Kind regards

Marc

 

Navigation:

[Reply to this 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

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