Skip to content

Commit 0d1898e

Browse files
committed
More badges!
1 parent 1880a32 commit 0d1898e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Latest Unstable Version](https://poser.pugx.org/mouf/magic-query/v/unstable)](https://packagist.org/packages/mouf/magic-query)
2+
[![License](https://poser.pugx.org/mouf/magic-query/license)](https://packagist.org/packages/mouf/magic-query)
13
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/thecodingmachine/magic-query/badges/quality-score.png?b=1.0)](https://scrutinizer-ci.com/g/thecodingmachine/magic-query/?branch=1.0)
24
[![Build Status](https://travis-ci.org/thecodingmachine/magic-query.svg?branch=1.0)](https://travis-ci.org/thecodingmachine/magic-query)
35
[![Coverage Status](https://coveralls.io/repos/thecodingmachine/magic-query/badge.svg?branch=1.0)](https://coveralls.io/r/thecodingmachine/magic-query?branch=1.0)
@@ -24,10 +26,12 @@ $magicQuery = new MagicQuery();
2426
// Let's pass only the "name" parameter
2527
$result = $magicQuery->build($sql, [ "name" => "%John%" ]);
2628
// $result = SELECT * FROM users WHERE name LIKE '%John%'
29+
// Did you notice how the bit about the country simply vanished?
2730

2831
// Let's pass no parameter at all!
2932
$result2 = $magicQuery->build($sql, []);
3033
// $result2 = SELECT * FROM users
34+
// The whole WHERE condition disappeared because it is not needed anymore!
3135
```
3236

3337
Installation
@@ -71,7 +75,7 @@ if (isset($params['country'])) {
7175
```
7276

7377
Concatenating SQL queries is **dangerous** (especially if you forget to protect parameters).
74-
You can always use parameterized SQL queries, but you will still have to concatenate the filters.
78+
You can always use parametrized SQL queries, but you will still have to concatenate the filters.
7579

7680
To avoid concatenating strings, frameworks and libraries have used different strategies. Building a full ORM (like
7781
Doctrine or Propel) is a good idea, but it makes writing complex queries even more complex. Other frameworks like

0 commit comments

Comments
 (0)