PHP
  Home arrow PHP arrow Generating View from MySQL to Simulate...
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 View from MySQL to Simulate the Model-View-Controller Schema in PHP
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 14
    2006-08-21

    Table of Contents:
  • Generating View from MySQL to Simulate the Model-View-Controller Schema in PHP
  • The starting point of a brand new MVC schema: defining some MySQL processing classes
  • Setting up the basics for generating disparate views: defining a controller based on MySQL datasets
  • Defining the next link of the chain: creating a model founded on native MySQL data sets
  • Generating distinct views from a single MySQL result set: creating an output generator class
  • Putting the classes to work together: seeing the MVC schema in action

  • 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 View from MySQL to Simulate the Model-View-Controller Schema in PHP


    (Page 1 of 6 )

    Are you a curious PHP developer, wanting to learn how to simulate a basic Model-View-Controller schema with PHP? Then, look no further, because you’re in the right place. Welcome to the final part of the series “Simulating the Model-View-Controller Schema in PHP.” In three tutorials, this series provides you with a comprehensive introduction, aimed at implementing a MVC-based relationship between PHP objects.

    Introduction

    If you've been one of those readers who has followed the first two installments of this series, then it's highly probably that you know how to define a specific interaction between several objects, which behave separately as a Model, a View and finally a Controller respectively (hence the name MVC).

    As you'll possibly recall, over the previous articles I walked you through a couple of hands-on examples to demonstrate how to implement easily the MVC schema with PHP (at least a very basic one). I showed you a basic case that illustrated how to define this type of relationship between a few simplistic message handling classes.

    Also, in order to move the schema in question much closer to a real situation, in the second article I developed a quite useful web page generating system, which was capable of attaching on the fly different style sheets, according to the instructions passed by a generic controller object.

    Of course, from the very beginning, the goal of this series was to demonstrate how to integrate the MVC schema in PHP. If, however, you're expecting to see something similar to the mechanism implemented in Ruby-on-Rails, then I recommend that you read specific material related to that language and its framework. That is beyond the scope of these articles. 

    All right, after refreshing the topics covered previously, as well as clarifying some key concepts with reference to the concrete subject of this series, this journey will continue by constructing yet another practical example to expand your overall knowledge of object-based programming with PHP. In particular, it's designed to show you to use a MVC-driven relationship in another real-world situation.

    If you're wondering to what other cases this relationship can be specifically applied, then I have good news for you. In this final article, I'll show you how to implement the MVC schema, in order to generate different outputs (or views) from a given MySQL data set.

    I'm pretty sure that this experience will be appealing to you, therefore let's see together how this can be achieved with PHP. Let's get started!

    More PHP Articles
    More By Alejandro Gervasio


       · In the last installment of this series, you'll learn how to implement a basic MVC...
     

       

    PHP ARTICLES

    - 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
    - Handling Attachments in MIME Email with PHP
    - Completing the Project Management Application





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