Skip to content

Commit

Permalink
Add example for changing SQL mode
Browse files Browse the repository at this point in the history
Fixes #124

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Jan 17, 2017
1 parent 2a589a3 commit f06862f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ $parser->statements[0]->from[0] = $table2;
$statement = $parser->statements[0];
$query2 = $statement->build();
var_dump($query2); // outputs string(19) "SELECT * FROM `b` "

// Change SQL mode
SqlParser\Context::setMode('ANSI_QUOTES');

// build the query again using different quotes
$query2 = $statement->build();
var_dump($query2); // outputs string(19) "SELECT * FROM "b" "
```

## More information
Expand Down

0 comments on commit f06862f

Please sign in to comment.