News Feed
Jobs Feed
Sections




Recent Jobs

News Archive
feed this:

Matt Butche's Blog:
MongoDB 5 Things Every PHP Developer Should Know About MongoDB
March 08, 2010 @ 11:44:43

Matt Butcher has a new post to his blog today with five things that every PHP developer should know about MongoDB, the popular NoSQL database project.

2010 is the year of the document database. While momentum has been steadily building over the last seven years or so, there are now a wide variety of stable document databases -- from cloud-based ones from Amazon and Google, to a wide variety of Open Source tools, most notably CouchDB and MongoDB. So what is MongoDB? Here are five things every PHP developer should know about it.

He points out a few things - that MongoDB is a stand-alone server, that it's schemaless, you won't need to learn another query language to use it and that PHP and MongoDB play very well together (thanks to the Mongo PECL package already released).

0 comments voice your opinion now!
mongodb introduction nosql database couchdb



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.

0 comments voice your opinion now!
pdo database mysql binary data


Lorna Mitchell's Blog:
Simple Database Patching Strategy
March 01, 2010 @ 14:10:53

In a new post to her blog today Lorna Mitchell has a few suggestions for handling database patching when your application starts to outgrow its simple roots.

One problem that seems to need solving too often is how to keep databases in sync across different platforms, different developers working on a project, and deploying database changes along with code changes. There are lots of ways of approaching this, none of them are really excellent however and personally I tend to err on the side of simple being better. Fewer dependencies means a solution more likely to work on every platform (and no additional complications for the live platform). Usually this means patch files of some kind.

She outlines her usual approach - creating a table with metadata and version information, export the structure of the database in push it into a row, creating numbered patch files and keeping it all stashed away in versioned source control for easy access. Check out the comments for some more interesting ideas.

0 comments voice your opinion now!
database patch strategy tutorial


NETTUTS.com:
ASP.NET for PHP Developers Part 2
February 19, 2010 @ 10:50:40

NETTUTS.com has posted the second part of their series looking to help PHP developers understand a bit more about the world of ASP.NET. This second part gets a bit more advanced than the first part.

It's been a hard climb for me, as a PHP guy for many years, to get to grips with ASP.NET. However I've found many good things in the framework, and have come to appreciate the power of the C# language - without losing my love for PHP.

He talks about using a development method he's come up with (rather than ASP.NET WebForms or ASP.NET MVC) because of his standards for the output, their reliance on Javascript and why he chose to learn the base .Net framework. He shows how to create a master page (template), work with custom classes, hook the script into databases and handling user controls.

0 comments voice your opinion now!
aspnet tutorial masterpage classes database usercontrol


ZendCasts.com:
Logging with Timestamps and Doctrine Event Listeners
February 18, 2010 @ 08:16:43

The ZendCasts.com site has recently posted a quick video covering logging and Doctrine event listeners in a Zend Framework application.

This short video is going to be the last in my 2009-2010 series on Doctrine 1.2. I'm wrapping it up with a little example of adding timestamps, logging and using Doctrine's event listener architecture.

The tutorial shows you how to pull in the features of Doctrine to make it easier to create a more complex logging system. He shows how to set up the schema file, add in controller functionality and backend models to make things all work together happily. You can get a copy of the project he's building from his subversion repository.

0 comments voice your opinion now!
timestamp logging doctrine database integration


Brian Swan's Blog:
Getting Started with the SQL Server Driver for PHP
February 10, 2010 @ 10:32:17

Brian Swan has posted a new guide for those wanting to get started using the SQL Server driver for PHP in their application development. His target of choice for the example is a SQL Server Express database.

I'll build a web page that exposes enough of the driver functionality for you to understand the basics of connecting to a server, inserting and retrieving data, and handling errors. A quick note about simplicity: The web page I'll build in this post is very simple '" it's just a simple form, really. It collects information about people who are registering for some fictional event. I'm intentionally keeping it very simple so I can focus on the PHP code for using the driver.

He walks you through the full process - everything from the installation of the driver to creating the database and, finally, building the page that connects to the SQL Server database and inserts/selects data from the sample table.

1 comment voice your opinion now!
sqlserver driver tutorial express database


The Bakery:
Simple way to memcache (almost) all database queries
January 13, 2010 @ 13:20:56

On The Bakery (the CakePHP resource) there's a recent post looking at a simple way you can integrate database query caching (using memcache) into your CakePHP application's models.

Most common way to access data is a database. Most common way to speed this up - Memcached. As a quite young CakePHP developer I had a bit of headache "how to cache queries effectively?". Now I know the way, so I share.

Rafal's method, as seen in this example using the caching methods included with CakePHP to serialize and store the database queries out to a cache.

0 comments voice your opinion now!
simple cakephp framework database query tutorial memcache


Ibuildings techPortal:
Learning PHP 5.3 by writing your own ORM
January 11, 2010 @ 15:28:00

In this new post from the Ibuildings techPortal today Peter Verhage suggests a good way to learn all about the new features in PHP 5.3 - build your own ORM system.

Creating an ORM for PHP is not an everyday task but writing one is a good way to improve your PHP skills, especially if you use some of the additional features PHP 5.3 adds to the language. There are many excellent ORMs (Object Relational Mappings) already in existence and for a real-world project it would probably better to use one of these, but this tutorial uses the task of creating an ORM as a way to take a look at applications for some PHP 5.3 features.

He makes use of namespaces, interfaces, static variable/method handling, magic methods like "__set" and "__unset" as well as abstract classes - all features of some of the latest PHP releases (5.2+). By the end you'll have a basic ORM layer that can do all of the usual CRUD operations as well as more complicated searching and a few things those familiar with the Zend Framework are used to.

0 comments voice your opinion now!
orm tutorial database feature


Matthew Turland's Blog:
Database Testing with PHPUnit and MySQL
January 05, 2010 @ 13:24:49

In a new post to his blog Matthew Turland looks at a contribution he recently made to the PHPunit project to help it support database testing without the need for dumping the contents of your database out to a CSV.

If you're using MySQL as your database, CSV has been the only format supported by both the mysqldump utility and the PHPUnit Database extension up to this point. My contribution adds support for its XML format to the extension. While this support was developed to work in the PHPUnit 3.4.x branch, it won't be available in a stable release until 3.5.0. In the meantime, this is how you can use it now.

There's four steps you'll need to do to get it installed - grab the latest from github, create the seed data XML file, make a test case extending PHPUnit_Extensions_Database_TestCase and run your tests against the database information.

0 comments voice your opinion now!
phpunit database testing mysql unittest


PaperMashup.com:
Easy PHP Pagination
December 22, 2009 @ 10:38:08

In a new post to Ashley Ford's blog there's a tutorial on paginating your data (from an array of data pulled from a database) with a simple PHP script:

I've had a few pagination scripts over the years but I thought i'd share the one that i'm currently using as it's a useful script to have in your toolbox. As a developer you'll soon find a need to paginate data when displaying contents from the database, and rather than use JavaScript which could require all the data to be loaded into the page on load, we can use PHP to ensure that we're only requesting the data that we need from the database.

Some sample code is included showing how to use the LIMIT statement (there's similar features in the other major databases) to only pull a subset of the data needed back into your script. Some CSS is also included to make it all look a bit. You can see it in action here and download the source here.

0 comments voice your opinion now!
pagination tutorial database



Community Events









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


zendframework release drupal framework symfony codeigniter windows podcast conference zend developer wordpress microsoft extension facebook performance job opinion feature sqlserver

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