We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 678edc3 commit d37e06fCopy full SHA for d37e06f
1 file changed
README.md
@@ -6,9 +6,24 @@ Install the library using composer
6
```
7
composer install syntactical/session
8
9
-Using a PDO MySQL session store
10
-```php
11
+##Using a PDO MySQL session store
+
12
+Create the table:
13
+```sql
14
+CREATE TABLE `sessions` (
15
+ `id` varchar(40) NOT NULL DEFAULT '0',
16
+ `ip` int(10) NOT NULL DEFAULT '0',
17
+ `user_agent` varchar(50) NOT NULL,
18
+ `last_activity` int(10) unsigned NOT NULL DEFAULT '0',
19
+ `data` text NOT NULL,
20
+ PRIMARY KEY (`id`),
21
+ KEY `last_activity` (`last_activity`)
22
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
23
+```
24
25
+Bootstrap the library:
26
+```php
27
$db = new PDO('mysql:host=your.db.host;dbname=db','username','password');
28
$table = 'sessions';
29
$storage = new MySQLStorage($db, $table);
0 commit comments