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
select(string $sql, array $where=null, int $fetch_mode=PDO::FETCH_ASSOC)
103
103
```
104
104
105
105
The following arguments exist:
@@ -110,19 +110,21 @@ The sql to perform the query to the database. (required)
110
110
For example:
111
111
112
112
```sql
113
-
SELECT*FROM`users`
113
+
SELECT*FROM`users`WHERE`username`= :username
114
114
```
115
115
116
-
#### SQL Where Clause (`$where`)
117
-
The sql where clause to filter the data from the database and so on. (optional)
116
+
#### Values for Where Clause (`$where`)
117
+
An array of the values to use in the where clause. (optional)
118
118
119
119
Default: `null`
120
120
121
121
Example:
122
-
```sql
123
-
WHERE`username`='Jack'
122
+
```php
123
+
[ 'username' => 'Jack' ]
124
124
```
125
125
126
+
Please note that you have to provide an associative array with keys that match to the placeholders in the sql query, unless you are not using the named placeholders in the query. In case you are just using the question marks as the placeholder, you can get rid of the keys.
127
+
126
128
#### PDO Fetch Mode (`$fetch_mode`)
127
129
The [pdo fetch mode](http://php.net/manual/en/pdostatement.fetch.php). Defines in which format the data is returned from the database. (optional)
0 commit comments