diff --git a/README.md b/README.md index 6176b61..5a1e3b4 100644 --- a/README.md +++ b/README.md @@ -137,9 +137,28 @@ Here is list of all SuperSQL flags: ], "number"); //Use $ssql->deleteTable($table[, $flags]) to delete a table - $c->deleteTable("myTable"); + $ssql->deleteTable("myTable"); //To see a list of all tables in your database use $ssql->tableList([$flags]) - print_r($c->tableList()); + print_r($ssql->tableList()); + + + //Advanced conditions + + + //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 + $ssql->read("users", $ssql->cond()->eq("username", "nickname")->gte("sign_up_time", time() - 3600)); + + //Use arrays to differentiate string values from column names and to specify more alternatives, the COND_OR flag is also supported + //This will select users that have username either "ratajs" or "admin" or that have username "RatajS" + $ssql->read("users", $ssql->cond()->eq("username", ["ratajs", "admin"])->eq("nickname", ["RatajS"], SQ::COND_OR)); + + //->not negates the condition, this will select users with usernames other than admin + $ssql->read("users", $ssql->cond()->eq("username", ["admin"])->not()); + + //It can also add another condition, this will select user that don’t have any nickname and with username other that "admin" or "root". + $ssql->read("users", $ssql->cond()->eq("nickname", [""])->not($ssql->cond()->eq("username", ["admin", "root"]))); + + //Supported condition functions: ->eq(), ->lt(), ->gt(), ->lte(), ->gte(), ->like() and ->between() ?> ```