Skip to content

Commit

Permalink
Version 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
faulkj committed Mar 3, 2024
1 parent dd5ac22 commit 09ecdf2
Show file tree
Hide file tree
Showing 4 changed files with 336 additions and 235 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# DB Changelog

Version 1.8 ***2024-03-02***
- Stricter typings
- Set ReturnDatesAsStrings to true by default
- Added options argument to connect method to override defaults
- New pQuery method to support prepared statements

Version 1.7 ***2023-08-09***
- Update to handle multiple result sets from a single query call
- Cleanup
Expand Down
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,31 @@ use FaulkJ\DB;

$db = new DB("myhost", "mydb", "username", "password");

$data = $db->query("SELECT * FROM mytable");
if(!$data->success) echo(implode("\n", $data->error));
else echo(json_encode($data->result));
$respose = $db->query("SELECT * FROM mytable");
if(!$respose->success) echo(implode("\n", $respose->error));
else echo(json_encode($respose->result));


$params = [
"apples",
"oranges",
12.34,
5,
true,
null,
321
];

if($dp->pQuery("
UPDATE mytable
SET favorite = ?
, leastFavorite = ?
, cost = ?,
, count = ?
, active = ?
, nullable = ?
WHERE id = ?
", $params)->success) {
echo "Table updated";
}
```
Loading

0 comments on commit 09ecdf2

Please sign in to comment.