@@ -137,9 +137,28 @@ Here is list of all SuperSQL flags:
137137 ], "number");
138138
139139 //Use $ssql->deleteTable($table[, $flags]) to delete a table
140- $c ->deleteTable("myTable");
140+ $ssql ->deleteTable("myTable");
141141
142142 //To see a list of all tables in your database use $ssql->tableList([$flags])
143- print_r($c->tableList());
143+ print_r($ssql->tableList());
144+
145+
146+ //Advanced conditions
147+
148+
149+ //You can use more advanced conditions with $ssql->cond(), this will select users that have the same username and nickname signed up in the last hour
150+ $ssql->read("users", $ssql->cond()->eq("username", "nickname")->gte("sign_up_time", time() - 3600));
151+
152+ //Use arrays to differentiate string values from column names and to specify more alternatives, the COND_OR flag is also supported
153+ //This will select users that have username either "ratajs" or "admin" or that have username "RatajS"
154+ $ssql->read("users", $ssql->cond()->eq("username", ["ratajs", "admin"])->eq("nickname", ["RatajS"], SQ::COND_OR));
155+
156+ //->not negates the condition, this will select users with usernames other than admin
157+ $ssql->read("users", $ssql->cond()->eq("username", ["admin"])->not());
158+
159+ //It can also add another condition, this will select user that don’t have any nickname and with username other that "admin" or "root".
160+ $ssql->read("users", $ssql->cond()->eq("nickname", [""])->not($ssql->cond()->eq("username", ["admin", "root"])));
161+
162+ //Supported condition functions: ->eq(), ->lt(), ->gt(), ->lte(), ->gte(), ->like() and ->between()
144163?>
145164```
0 commit comments