Advertisement
Free Mambo Templates - Free Joomla Templates
Joomla Hut HomeContact UsJoomla LinksMambo Forum - Joomla ForumJoomla Downloads
Home
News
Articles
Gallery
Downloads
Tutorials
Site Reviews
Flash Tutorials
Templates Demo
Joomla Links
FAQ
Advertise Here
Search
Advertisement
Seek Your Host
New York Web Design
Joomla Templates
Login Form





Lost Password?
No account yet? Register
Joomla Extensions
Joomla Templates
TemplatePlazza
 
Joomla Website

Creating a quick and easy Mambo component Print E-mail
Written by Doyle Lewis   
Thursday, 15 April 2004

class.hello_world.php - The database class file.

<?php
//hello_world Component//
/**
* Content code
* @package hello_world
* @Copyright (C) 2004 Doyle Lewis
* @ All rights reserved
* @ hello_world is Free Software
* @ Released under GNU/GPL License : http://www.gnu.org/copyleft/gpl.html
* @version 1.0
**/

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

class mosHello_world extends mosDBTable {
  // INT(11) AUTO_INCREMENT
  var $id=null;
  // TEXT
  var $text=null;
  // TINYINT(1)
  var $published=null;

  function mosHello_world( &$db ) {
    $this->mosDBTable( 'mos_hello_world', 'id', $db );
  }
}

Now let's look at how the file works:

class mosHello_world extends mosDBTable {
This line will always look like this, but change mosHello_world to what you want your class named.

  // INT(11) AUTO_INCREMENT
  var $id=null;
The commented line just gives info about the variable. The variable line has to match your db column exactly, and always set it equal to null.

  function mosHello_world( &$db ) {
    $this->mosDBTable( 'mos_hello_world', 'id', $db );
  }
This is what creates your output when you use $row = new mosHello_world( $database );

 


 
< Prev   Next >
 
 
Joomla Jobs
 
 
Joomla Flash Tutorials
   
     
Home   |   Contact   |   Links   |   Forum   |   Downloads  |  Media Kit
 

© Copyright 2003 - 2006 by BUYHTTP, LLC. All rights reserved.
None of the text or images in this public website may be copied without the expressed written consent of the authors.
Powered By Joomla!

Joomla Top Sites - Your Primary Source of Joomla Traffic