News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jeremy Cook's Blog:
Handling Binary Data with PDO
March 03, 2010 @ 14:48:56

Jeremy Cook has put together a quick guide for something that can be tricky when using PDO in PHP - handling binary data in the return from your queries.

I like the fact that if I needed to use MS SQL Server, Oracle or any of the other big RDBMS's I could use the same PDO syntax to access them rather than learning a new database access library. However, there do seem to be some bugs in PDO according to what I've read on the web. While I haven't encountered most of them and can't comment on them I'd like to write about one that I ran into the other day and how I worked around it.

He was storing images in the database and pushing the information into the database was working fine. When he tried to pull the contents back out, however, the information wasn't being handled correctly (according to the example in the PHP manual) because of a differing return value for the fetch call - sometimes it's a string but, in this case, it's binary data so it needs to just be passed on through.

1 comment voice your opinion now!
pdo database mysql binary data


blog comments powered by Disqus

Similar Posts

Job Posting: WildCog Seeks Senior Database Engineer (San Francisco/Mountain View, CA)

PHPEasy.co.uk: Sorting array data using SplMaxHeap

Nick Halstead's Blog: How to make AuctionAd$ dynamic with PHP

Jani Hartikainen's Blog: Food for thought: utilizing models in MVC

Edin Kadribasic's Blog: PHP 4.4.6-win32 with MySQL 5.0.37


Community Events





Don't see your event here?
Let us know!


update series voicesoftheelephpant tool library interview introduction podcast security language release package laravel composer community opinion framework mvc symfony version

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework