Skip to content

Commit 45ba721

Browse files
authored
Updated docs for fetching results.
More things are remaining, will update docs soon.
1 parent 2e1052e commit 45ba721

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,28 @@ $db->table('tablename');
1515
// Fetching results
1616
DB::table('tablename')->get(); // will fetch every result from table
1717
```
18+
19+
### For Complex Querying
20+
```php
21+
$query = DB::table('tablename')->query("SELECT col, FROM @table . . .");
22+
23+
// @table refer to current table reference, if set with table() method.
24+
```
25+
26+
### Fetching results
27+
```php
28+
29+
/**
30+
* obj | array stash($type = '{}' || '[]')
31+
* obj | array record($type = '{}' || '[]')
32+
*
33+
* $type parameter can be '{}' fetching results as object or '[]' for arrays
34+
* $type parameter by default set to '{}'
35+
*/
36+
37+
// single result
38+
$result = $query->stash();
39+
40+
// for heap of results
41+
$result = $query->record();
42+
```

0 commit comments

Comments
 (0)