Alternc  3.2
Alternc logiel libre pour l'h├ębergement
 All Data Structures Namespaces Files Functions Variables Pages
DB_users Class Reference

MySQL user database management for AlternC. More...

+ Inheritance diagram for DB_users:

Public Member Functions

 DB_users ($empty=false)
 Creator.
- Public Member Functions inherited from DB_Sql
 DB_Sql ($query="")
 Constructor.
 link_id ()
 query_id ()
 connect ($Database="", $Host="", $User="", $Password="")
 function for MySQL database connection management
 free ()
 Discard the query result.
 query ($Query_String)
 Perform a query.
 next_record ()
 walk result set
 seek ($pos=0)
 public: position in result set
 lock ($table, $mode="write")
 unlock ()
 affected_rows ()
 num_rows ()
 num_fields ()
 nf ()
 np ()
 f ($Name)
 p ($Name)
 lastid ()
 nextid ($seq_name)
 metadata ($table='', $full=false)
 halt ($msg)
 haltmsg ($msg)
 table_names ()

Data Fields

 $Host
 $HumanHostname
 $User
 $Password
 $Client
- Data Fields inherited from DB_Sql
 $Host = ""
 $Database = ""
 $User = ""
 $Password = ""
 $Auto_Free = 0
 $Debug = 0
 $Halt_On_Error = "no"
 $Seq_Table = "db_sequence"
 $Record = array()
 $Row
 $Errno = 0
 $Error = ""
 $type = "mysql"
 $revision = "1.2"
 $Link_ID = 0
 $Query_ID = 0
 $Query_String = ""

Detailed Description

MySQL user database management for AlternC.

This class manage user's databases in MySQL, and user's MySQL accounts.

Definition at line 37 of file m_mysql.php.

Member Function Documentation

DB_users (   $empty = false)

Creator.

Definition at line 43 of file m_mysql.php.

References $cuid, $db, $err, and DB_Sql\connect().

{ // Sometimes we need to create this object with empty parameters, but by default we fill them with those of the current user's DB
global $cuid, $db, $err;
if (!$empty){
$db->query("select db_servers.* from db_servers, membres where membres.uid=$cuid and membres.db_server_id=db_servers.id;");
if (!$db->next_record()) {
$err->raise('db_user', _("There are no databases in db_servers for this user. Please contact your administrator."));
die();
}
# Create the object
$this->HumanHostname = $db->f('name');
$this->Host = $db->f('host');
$this->User = $db->f('login');
$this->Password = $db->f('password');
$this->Client = $db->f('client');
$this->Database = "mysql"; # We have to define a dabatase when we connect, and the database must exist.
}else{
# Create the object without any parameter
$this->HumanHostname = "";
$this->Host = "";
$this->User = "";
$this->Password = "";
$this->Client = "";
$this->Database = "mysql"; # We have to define a dabatase when we connect, and the database must exist.
}
}

Field Documentation

$Client

Definition at line 38 of file m_mysql.php.

$Host

Definition at line 38 of file m_mysql.php.

$HumanHostname

Definition at line 38 of file m_mysql.php.

$Password

Definition at line 38 of file m_mysql.php.

$User

Definition at line 38 of file m_mysql.php.


The documentation for this class was generated from the following file: