Skip to content

Commit 4771bfc

Browse files
authored
Update README.md
1 parent 6d996a6 commit 4771bfc

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

README.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,39 @@ Set inital query and pass search query to your mysql connection
5050

5151
```php
5252
$search->setSQLQuery("SELECT * FROM code WHERE id = 1323");
53-
$db->conn()->prepare($search->getQuery());
53+
$db->conn()->prepare($search->getAndQuery());
5454
$db->conn()->execute();
5555
$resault = $db->conn()->getAll();
5656
$db->conn()->free();
5757
```
5858
OR bulid it with other sql query like below in your mysql connection
5959
```php
60-
$db->conn()->prepare("SELECT * FROM code " . $search->getQuery() . " AND id = 1323");
60+
$db->conn()->prepare("
61+
SELECT * FROM code
62+
{$search->getWhereQuery()}
63+
AND id = 1323
64+
");
6165
$db->conn()->execute();
6266
$resault = $db->conn()->getAll();
6367
$db->conn()->free();
6468
```
6569

70+
# Other Methods
71+
72+
Returns the computed sql search queries by checking if initial query was specified or not to determine which start clause is needed.
73+
```php
74+
$search->getQuery()
75+
```
76+
77+
Returns the computed search queries by using `AND` as the start clause.
78+
```php
79+
$search->getAndQuery()
80+
```
81+
Returns the computed search queries by using `WHERE` as the start clause.
82+
```php
83+
$search->getWhereQuery()
84+
```
85+
6686
# Refrence
6787

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

0 commit comments

Comments
 (0)