| Line 6... |
Line 6... |
| 6 |
//session_destroy(); die;
|
6 |
//session_destroy(); die;
|
| 7 |
// make a connection to the database
|
7 |
// make a connection to the database
|
| 8 |
mysqli_report( MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT );
|
8 |
mysqli_report( MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT );
|
| 9 |
$mysqlConnection = new mysqli( 'localhost', 'test', 'test', 'test' );
|
9 |
$mysqlConnection = new mysqli( 'localhost', 'test', 'test', 'test' );
|
| 10 |
// create a data source
|
10 |
// create a data source
|
| 11 |
$connection = new usersDataSource( $mysqlConnection );
|
11 |
$connection = new usersDataSourceMySQLi( $mysqlConnection );
|
| 12 |
// check if table exists and, if not, create it with username admin, password admin
|
12 |
// check if table exists and, if not, create it with username admin, password admin
|
| 13 |
if ( ! $connection->test() ) {
|
13 |
if ( ! $connection->test() ) {
|
| 14 |
$initValues = array(
|
14 |
$initValues = array(
|
| 15 |
'users' => array(
|
15 |
'users' => array(
|
| 16 |
'login' => 'admin',
|
16 |
'login' => 'admin',
|