Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane committed Feb 28, 2020
2 parents cd81180 + 62a83b5 commit f7e1402
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,15 @@ $query->updateRecord([
'username'=>'MySuperHeroIsYou',
'password'=>'f5d44b6d4a7d91821d602d03c096280e86888fa16cf9c27c540bbc2fd4e73932',
],
['user-id'=>99,]);
[
'user-id'=>99
]);
```
#### Delete
The method `MySQLQuery::insertRecord()` is used to create an `insert` query. The method accepts an associative array. The keys of the array are columns keys and the values of the keys are the values that will be inserted.
The method `MySQLQuery::deleteRecord()` is used to create a `delete` query. The method accepts an associative array that has delete condition columns (the `where` part of the delete query).
``` php
$query->insertRecord([
'user-id'=>99,
'username'=>'MySuperHeroIsYou',
'password'=>'f5d44b6d4a7d91821d602d03c096280e86888fa16cf9c27c540bbc2fd4e73932',
'created-on'=>date('Y-m-d H:i:s')
$query->deleteRecord([
'user-id'=>99
]);
```
### Connecting to MySQL Database
Expand Down
2 changes: 1 addition & 1 deletion src/MySQLQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -2027,6 +2027,6 @@ public function getTable() {
return $this->table;
}
public function __toString() {
return 'Query: '.$this->getQuery().'<br/>'.'Query Type: '.$this->getType().'<br/>';
return $this->getQuery();
}
}

0 comments on commit f7e1402

Please sign in to comment.