Browse Source

update prepared statements link (#18911)

tags/2.0.44
Ihor Sychevskyi 3 years ago committed by GitHub
parent
commit
435b6dc732
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docs/guide-fr/db-dao.md
  2. 2
      docs/guide-zh-CN/db-dao.md
  3. 2
      docs/guide/db-dao.md

2
docs/guide-fr/db-dao.md

@ -164,7 +164,7 @@ $post = Yii::$app->db->createCommand('SELECT * FROM post WHERE id=:id AND status
->queryOne();
```
La liaison des paramètres est implémentée via des [instructions préparées](https://secure.php.net/manual/en/mysqli.quickstart.prepared-statements.php). En plus d'empêcher les attaques par injection SQL, cela peut aussi améliorer la performance en préparant l'instruction SQL une seule fois et l'exécutant de multiples fois avec des paramètres différents. Par exemple :
La liaison des paramètres est implémentée via des [instructions préparées](https://www.php.net/manual/en/mysqli.quickstart.prepared-statements.php). En plus d'empêcher les attaques par injection SQL, cela peut aussi améliorer la performance en préparant l'instruction SQL une seule fois et l'exécutant de multiples fois avec des paramètres différents. Par exemple :
```php
$command = Yii::$app->db->createCommand('SELECT * FROM post WHERE id=:id');

2
docs/guide-zh-CN/db-dao.md

@ -184,7 +184,7 @@ $post = Yii::$app->db->createCommand('SELECT * FROM post WHERE id=:id AND status
->queryOne();
```
绑定参数是通过 [预处理语句](https://secure.php.net/manual/en/mysqli.quickstart.prepared-statements.php) 实现的。
绑定参数是通过 [预处理语句](https://www.php.net/manual/en/mysqli.quickstart.prepared-statements.php) 实现的。
除了防止 SQL 注入攻击,它也可以通过一次预处理 SQL 语句,
使用不同参数多次执行,来提升性能。例如:

2
docs/guide/db-dao.md

@ -190,7 +190,7 @@ $post = Yii::$app->db->createCommand('SELECT * FROM post WHERE id=:id AND status
->queryOne();
```
Parameter binding is implemented via [prepared statements](https://secure.php.net/manual/en/mysqli.quickstart.prepared-statements.php).
Parameter binding is implemented via [prepared statements](https://www.php.net/manual/en/mysqli.quickstart.prepared-statements.php).
Besides preventing SQL injection attacks, it may also improve performance by preparing a SQL statement once and
executing it multiple times with different parameters. For example,

Loading…
Cancel
Save