|
OpenSencillo
2015.002
|
Inheritance diagram for mysql:Public Member Functions | |
| __construct ($DBHost, $DBName, $DBUser, $DBPass) | |
| query ($sql) | |
| write ($sql) | |
| close () | |
| test () | |
Data Fields | |
| $DBHost | |
| $DBName | |
| $DBUser | |
| $DBPass | |
| $con | |
Private Attributes | |
| $checksum | |
Definition at line 27 of file core_sql.php.
| __construct | ( | $ | DBHost, |
| $ | DBName, | ||
| $ | DBUser, | ||
| $ | DBPass | ||
| ) |
Create connection
| string | $DBHost | |
| string | $DBName | |
| string | $DBUser | |
| string | $DBPass |
Reimplemented in logMan.
Definition at line 43 of file core_sql.php.
{
$this->DBHost = $DBHost;
$this->DBName = $DBName;
$this->DBUser = $DBUser;
$this->DBPass = $DBPass;
if(($this->DBHost!='')&&($this->DBUser!='')&&($this->DBPass!='')&&($this->DBName!=''))
{
$this->checksum=md5($this->DBHost.$this->DBUser.$this->DBPass.$this->DBName);
}
$this->con = mysql_connect($this->DBHost, $this->DBUser, $this->DBPass);
if(! $this->con)
{
die("<b>core_sql: MySQL connection failed!</b> ".mysql_error());
}
mysql_select_db($this->DBName, $this->con);
}
| close | ( | ) | [final] |
| query | ( | $ | sql | ) | [final] |
Add query to database
| string | $sql |
Definition at line 66 of file core_sql.php.
{
mysql_query($sql);
}
| test | ( | ) | [final] |
Test connection
Definition at line 92 of file core_sql.php.
{
if($this->checksum==md5($this->DBHost.$this->DBUser.$this->DBPass.$this->DBName))
{
if(! $this->con)
{
return mysql_error();
}
else
{
return true;
}
}
}
| write | ( | $ | sql | ) | [final] |
Add query to database
| string | $sql |
Definition at line 75 of file core_sql.php.
{
$this->query($sql);
}
$checksum [private] |
Definition at line 33 of file core_sql.php.
| $con |
Definition at line 34 of file core_sql.php.
| $DBHost |
Definition at line 29 of file core_sql.php.
| $DBName |
Definition at line 30 of file core_sql.php.
| $DBPass |
Definition at line 32 of file core_sql.php.
| $DBUser |
Definition at line 31 of file core_sql.php.