PHP
  Home arrow PHP arrow Generating Outputs from MySQL with Sta...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Generating Outputs from MySQL with Static Members and Methods in PHP 5
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2006-10-09

    Table of Contents:
  • Generating Outputs from MySQL with Static Members and Methods in PHP 5
  • Working with MySQL
  • Creating the ResultToString, ResultToXML and ResultToArray classes
  • Defining the ResultProcessorFactory class

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Generating Outputs from MySQL with Static Members and Methods in PHP 5


    (Page 1 of 4 )

    Trying to expand beyond the boundaries of your existing background by learning how to code and use static methods and properties inside your PHP 5 classes? Then look no further. Welcome to the last part of the series “Using static members and methods in PHP 5.” Made up of two instructive chapters, this series introduces the foundations of using static members and defines static methods in PHP 5-driven development environments.

    Introduction

    If you’re anything like me, then it’s quite probable that you’ve already included static members and methods in your PHP 5 classes, which means that you should consider yourself a fairly experienced developer.

    On the other hand, for those who are completely new to the object model introduced with PHP 5, the subject in question is quite simple: essentially, static methods are those that are callable from outside the regular object context (using the :: scope resolution operator), and therefore can to be invoked without needing to use a specific class instance.

    In addition, properties that have been declared static inside a class should be accessed from outside the object scope, via the “self” keyword, instead of using the $this pseudo variable. However, even though all these concepts may sound a bit intimidating, things are much simpler than you think, since declaring class methods and properties static is achieved by prefixing them with the “static” PHP keyword. That’s all.

    Of course, as with most features of a specific programming language, using static members and methods needs to be taught by practical examples, which leads directly to the subject of this article. Since in the first tutorial you were provided with a couple of concrete cases where a class used a static property, as well as one static method (remember the definition of the Singleton class), in this tutorial you’ll see another example where these kinds of methods and members are properly utilized.

    Specifically, I’ll show you how to use static methods to generate disparate outputs from MySQL database tables. If this topic sounds appealing to you, it’s time to get started. Let’s go!

    More PHP Articles
    More By Alejandro Gervasio


       · This final article of the series is pointed out to demonstrate how to use static...
     

       

    PHP ARTICLES

    - Validating Web Forms with the Code Igniter P...
    - Output Buffering
    - Paginating Database Records with the Code Ig...
    - HTTP Headers in Web Development
    - Project Management: Administration
    - Building a Database-Driven Application with ...
    - User Authentication for a Project Management...
    - Introduction to the CodeIgniter PHP Framework
    - Adding Users for a Project Management Applic...
    - Migrating Class Code for a MIME Email to PHP...
    - Login and Logout Authentication for a Projec...
    - Composing Messages in HTML for MIME Email wi...
    - Project Management: Authentication
    - A Better Way to Determine MIME Types for MIM...
    - Project Management Overview





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway