Database_Connection
in package
A connection to database stored as an object.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- Build a new connection object.
- getAsText() : string
- Connection a PHP formatted string.
- loadFile() : void
- Load data from a PHP file.
Properties
$dbname
public
string
$dbname
Database name
$passwd
public
string
$passwd
Password for this user
$server
public
string
$server
Server name
$socket
public
string
$socket
Socket to use
$userid
public
string
$userid
User ID
Methods
__construct()
Build a new connection object.
public
__construct([string $server = "" ][, string $userid = "" ][, string $passwd = "" ][, string $dbname = "" ][, string $socket = "" ]) : mixed
Parameters
- $server : string = ""
-
Server name
- $userid : string = ""
-
User ID
- $passwd : string = ""
-
Password for this user
- $dbname : string = ""
-
Database name
- $socket : string = ""
-
Socket to use
getAsText()
Connection a PHP formatted string.
public
getAsText() : string
Return values
string —PHP string representing connection details
loadFile()
Load data from a PHP file.
public
loadFile(string $file_name) : void
The file is usually connect.inc.php or equivalent.
Parameters
- $file_name : string
-
PHP file to load data from.