Skip to content

Commit 8c79eb6

Browse files
authored
Update README.md
1 parent 4b5a8e8 commit 8c79eb6

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ $search->setTags("code_tags");
4949
Set inital query and pass search query to your mysql connection
5050

5151
```php
52-
$search->setSQLQuery("SELECT * FROM code WHERE id = 1323");
53-
$db->conn()->prepare($search->getAndQuery());
52+
$search->setIniQuery("SELECT * FROM code WHERE id = 1323");
53+
$db->conn()->prepare($search->getQuery());
5454
$db->conn()->execute();
55-
$resault = $db->conn()->getAll();
55+
$result = $db->conn()->getAll();
5656
$db->conn()->free();
5757
```
5858
OR bulid it with other sql query like below in your mysql connection
@@ -63,7 +63,7 @@ $db->conn()->prepare("
6363
AND id = 1323
6464
");
6565
$db->conn()->execute();
66-
$resault = $db->conn()->getAll();
66+
$result = $db->conn()->getAll();
6767
$db->conn()->free();
6868
```
6969

@@ -74,16 +74,31 @@ Returns the computed sql search queries by checking if initial query was specifi
7474
$search->getQuery()
7575
```
7676

77-
Returns the computed search queries by using `AND` as the start clause.
77+
Set your search keyword
78+
79+
```php
80+
$search->setQuery("Foo Bar")
81+
```
82+
83+
Split search keyword `Foo Bar` into `Foo`, `Bar` as separate search terns
7884
```php
79-
$search->getAndQuery()
85+
$search->split()
8086
```
81-
Returns the computed search queries by using `WHERE` as the start clause.
87+
88+
Mapping your database column keys to perform search on
89+
90+
```php
91+
$search->setParameter(array)
92+
```
93+
94+
95+
Set initial SQL query before appending search after your query string
96+
8297
```php
83-
$search->getWhereQuery()
98+
$search->setIniQuery('SELECT * FROM ...')
8499
```
85100

86-
# Refrence
101+
# Reference
87102

88103
Specify search operator `$search->setOperators(SearchController::HAVE_ANY_QUERY)`
89104

@@ -98,7 +113,7 @@ Specify search operator `$search->setOperators(SearchController::HAVE_ANY_QUERY)
98113
| START_END_WITH_QUERY | Finds any values that start with "query" and ends with "query" |
99114

100115

101-
Initalise search class with a method `new SearchController(SearchController::OR)`
116+
Initialize search class with a method `new SearchController(SearchController::OR)`
102117

103118
| Search Methods | Description |
104119
|------------------------|-------------------------------------------------------------------------------------|

0 commit comments

Comments
 (0)