News Feed
Sections




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

Harry Roberts' Blog:
Manipulating PHP arrays with SQL
May 22, 2008 @ 14:39:54

Harry Roberts has a quick post to his blog today showing a method he's come up with to handle PHP arrays from inside of SQL statements (a port of the JsonSQL library to PHP).

Trent Richardson created a very small and simple JsonSQL library for JavaScript which allows you to run an extremely limited subset of SQL against a Json array/object. I quickly ported it over to PHP 5 and it works like a charm, although the syntax for the WHERE clause isn't exactly the same but the rest ported across properly.

He's included some sample source code of it in action - selecting information out of an array of user information, once changing their order and the other grabbing a username. Complete source for the library is included too.

0 comments voice your opinion now!
manipulate array sql statement phpsql library port jsonsql


blog comments powered by Disqus

Similar Posts

PHPMaster.com: Exploring PHP’s IMAP Library, Part 2

Smarx.com: PHP for Microsoft AJAX Library

Max Horvath's Blog: Type Hints for scalar values - PHPTypeSafe now compatible with current PHP 5.3

Matthew Weir O'Phinney's Blog: Introducing Phly_Struct and Phly_Config

MongoDB Blog: Call for Feedback: The New PHP and HHVM Drivers


Community Events

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


symfony2 framework release podcast php7 version conference opinion api library series example extension voicesoftheelephpant performance introduction application interview laravel community

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