Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use the JTable Class

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 113
    Comment on it

    Table is an abstract class which models the database and need to put constructor which declares the table name and primary key and also override some methods. It is used for creating,updating, reading and deleting of records in database. As this class is abstract so few methods will be overridden by the child class. Some of the methods which JTable provides for manipulating the records in database are Load,save etc.
    For using JTable class we need to create class which inherit parent class JTable define constructor inside which will call the parent constructor to get the table. Inside constructor need to provide name of table, primarykey field column and database instance.

     class TableMytable extends JTable
        {
           public function __construct($db)
           {
             parent::__construct( '#__mytable', 'id', $db );
           }
        }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: