File tree 1 file changed +22
-2
lines changed
1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -50,19 +50,39 @@ Set inital query and pass search query to your mysql connection
50
50
51
51
``` php
52
52
$search->setSQLQuery("SELECT * FROM code WHERE id = 1323");
53
- $db->conn()->prepare($search->getQuery ());
53
+ $db->conn()->prepare($search->getAndQuery ());
54
54
$db->conn()->execute();
55
55
$resault = $db->conn()->getAll();
56
56
$db->conn()->free();
57
57
```
58
58
OR bulid it with other sql query like below in your mysql connection
59
59
``` 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
+ ");
61
65
$db->conn()->execute();
62
66
$resault = $db->conn()->getAll();
63
67
$db->conn()->free();
64
68
```
65
69
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
+
66
86
# Refrence
67
87
68
88
Specify search operator ` $search->setOperators(SearchController::HAVE_ANY_QUERY) `
You can’t perform that action at this time.
0 commit comments