STAG - documentation
[ class tree: STAG - documentation ] [ index: STAG - documentation ] [ all elements ]

Class: sql

Source Location: /classes/sql.php

Class Overview


file contained class which provide all operation over database


Variables

Methods



Class Details

[line 6]
file contained class which provide all operation over database



[ Top ]


Class Variables

$password =

[line 9]



Tags:

access:  protected

Type:   mixed


[ Top ]

$query =

[line 13]



Tags:

access:  public

Type:   mixed


[ Top ]

$server =

[line 7]



Tags:

access:  protected

Type:   mixed


[ Top ]

$username =

[line 8]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 24]

sql __construct( [string $server = db_server], [string $username = db_user], [string $password = db_pass], [string $database = db])

connect to DB, open table save info to $connection



Tags:

access:  public


Parameters:

string   $server   server adress (not necessary - readed from config.php file)
string   $username   login name to database (not necessary - readed from config.php file)
string   $password   login password to database (not necessary - readed from config.php file)
string   $database   database table name (not necessary - readed from config.php file) default you can call only sql::__construct();

[ Top ]

destructor __destruct [line 138]

void __destruct( )

close MySQL connection



Tags:

access:  public


[ Top ]

method close [line 131]

void close( )



Tags:

access:  public


[ Top ]

method delete [line 125]

BOOLEAN delete( string $table, integer $id)

delete database about ID. delete(table, ID), return BOOLEAN



Tags:

return:  true when deleting was successful
access:  public


Parameters:

string   $table   table with which is working
integer   $id   unique value of deleted row in table

[ Top ]

method fetch_array [line 55]

array fetch_array( )

chop database result to rows, return array



Tags:

return:  from mysql database when no data return FALSE
access:  public


[ Top ]

method insert [line 79]

void insert( string $table, string $value)

inserting data into database insert_into('table', 'values')



Tags:

access:  public


Parameters:

string   $table   table where will be included data
string   $value   value which will be included into database return BOOLEAN

[ Top ]

method num_rows [line 68]

integer num_rows( )



Tags:

return:  number of rows
access:  public


[ Top ]

method query [line 45]

void query( SQL $query)

send query to database, return data



Tags:

access:  public


Parameters:

SQL   $query   mysql query $return resource $this->result

[ Top ]

method select [line 110]

BOOLEAN select( string $table, [string $value = '*'], [string $what = '*'])

select database about ID. delete(table, complete query), return BOOLEAN



Tags:

return:  true when select have some value
access:  public


Parameters:

string   $table   table with which is working
string   $value   value which will be readed from database (not necessary needed - default all data)
string   $what   select column which want get from table

[ Top ]

method update [line 94]

BOOLEAN update( string $table, integer $id, string $value)

update database table about ID update(table, ID, column, value)



Tags:

return:  true when update was successful
access:  public


Parameters:

string   $table   table where will be included data
integer   $id   unique value of edited row in table
string   $value   value which will be included into database

[ Top ]


Documentation generated on Sat, 24 Jan 2009 19:10:32 +0100 by phpDocumentor 1.4.1