Class Database
Database is to handle the connetion between the database server and the IntroNet classes
Located at classes/Database.php
Methods summary
public static
table
|
#
get( String $table )
Gets the entire table form the database
Gets the entire table form the database
Parameters
Returns
table
|
public static
|
#
getObjects( string $name, string $options = "", string $sql = "" )
This function is used to get the objects from the database
This function is used to get the objects from the database
Parameters
- $name
- this is the name of the object
- $options
- this is the list of options
- $sql
- this is the sql query to get the objects from the database
|
public static
object
|
#
getObject( string $name, string $where )
Parameters
- $name
- this parameter searches the name object from datbase
- $where
- this parameter searched the object using where condition
Returns
object The object of type name else retuns false if it doesn't exists in database
|
public static
number
|
#
count( string $name, string $options = "" )
Counts the number of tables
Counts the number of tables
Parameters
- $name
- These are the names of the tables
- $options
- These are the extra options that will be added with the query
Returns
number this function returns the total number of rows tables
|
public static
boolean
|
#
insert( String $table, array $values, $id = Null )
Inserting a new row in a table
Inserting a new row in a table
Parameters
- $table
- name of the database table
- $values
- $data the new row's data the needs to be inserted
- $id
Returns
boolean
|
public static
boolean
|
#
delete( String $table, String $id )
Deletes a row from a table
Deletes a row from a table
Parameters
- $table
- The name of the table where the row is
- $id
- The id of the row that needed to be deleted
Returns
boolean True if the row was deleted, False if the row wasn't deleted
|
public static
updatedtable
|
#
update( string $name, string $values, integer $id )
This function updates the table
This function updates the table
Parameters
Returns
updatedtable
|