-
Notifications
You must be signed in to change notification settings - Fork 0
Database connection
AngelNovo edited this page Aug 10, 2024
·
5 revisions
- PDO
- Mysql
The enviroment variables for the mysql_database
must be set
just like the example
use lib\connection\Mysql
$db = new Connection();
$sql = $db->newQuery('show tables');
/* Data will contain a dataset with the query result */
$data = $sql->Execute();
// Do not forget to close the connection
$sql->close();
$sql = $db->newQuery('select * from table_name where id = :id');
$sql->params->id = 23