PHP_Framework

Wh1t3projects' PHP framework. Small PHP framework for building web apps and websites

View the Project on GitHub

Syntax: SQL_connect([string $host, string $user, string $pass, string $dbname])

Connect to an SQL server using the driver specified in the configuration. If no parameters is specified, the function will take the information set in the config. Otherwise, ALL parameters must be specified.


Parameters

Optional $host
SQL server host name or IP address.

Optional $user
Username to use for authentication

Optional $pass
Password to use for authentication

Optional $dbname
Database name.


Return values

If the connection is successful and the database can be opened, the SQL ressource identifier is returned. If an error occur, FALSE will be returned and the error will be reported to the framework log.


Examples:

Connect to the SQL server with the default values (config.php)
SQL_connect();

Connect to the SQL server with custom parameters
SQL_connect("localhost","testuser","userpassword","testdb");


Additional informations
If the connection is successful, the SQL_resid function will be called to store the ressource ID in memory.