You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+9-9
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ Let’s have a table “<strong>users</strong>” with 5 columns: `uid`, `userna
13
13
include "ssql.php";
14
14
15
15
//Connect with new Ssql($host[, $user[, $password[, $database]]])
16
-
$ssql = new Ssql("localhost", "root", "root", "db");
16
+
$ssql = new Ssql("localhost", "root", "root", "db"); // MySQL
17
17
18
18
//Connect to SQLite with just the first parameter
19
19
$ssql = new Ssql("db.sqlite");
20
20
21
21
//To execute raw SQL query use $ssql->q($q[, $a]), FETCH_ALL returns an array of rows, FETCH_OBJECT and FETCH_ARRAY return one row per call
22
-
$ssql->q("SELECT * FROM users")->fetch(SMQ::FETCH_ALL);
22
+
$ssql->q("SELECT * FROM users")->fetch(SQ::FETCH_ALL);
23
23
24
24
//You can use wildcards for escaping
25
25
$ssql->q("SELECT * FROM users WHERE `username`=%0 OR `nickname`=%1", [$name, $nick])->fetch();
@@ -30,23 +30,23 @@ Let’s have a table “<strong>users</strong>” with 5 columns: `uid`, `userna
30
30
31
31
//For simple requests use $ssql->read($table[, $flags]) or $ssql->read($table, $cond[, $flags])
32
32
//Read function uses FETCH_SMART as default (FETCH_OBJECT for one row, FETCH_ALL for more), so you need to use the FETCH_ALL flag to return an array even when there is only one result
0 commit comments