rfc:mysqli_execute_query
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:mysqli_execute_query [2022/04/24 13:35] – Example of old/unsafe escaping (thanks Guilliam) craigfrancis | rfc:mysqli_execute_query [2022/08/04 13:28] (current) – Target Version: PHP 8.2 dharman | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: MySQLi Execute Query ====== | ====== PHP RFC: MySQLi Execute Query ====== | ||
- | * Version: | + | * Version: 1 |
- | * Voting Start: ? | + | |
- | * Voting End: ? | + | |
* RFC Started: 2022-04-21 | * RFC Started: 2022-04-21 | ||
- | * RFC Updated: 2022-04-21 | + | * RFC Updated: 2022-05-11 |
+ | * Voting Start: 2022-05-11 15:00 UTC / 16:00 BST | ||
+ | * Voting End: 2022-05-25 15:00 UTC / 16:00 BST | ||
* Author: Kamil Tekiela, and Craig Francis [craig# | * Author: Kamil Tekiela, and Craig Francis [craig# | ||
- | * Status: | + | * Status: |
+ | * Target Version: PHP 8.2 | ||
* First Published at: https:// | * First Published at: https:// | ||
* GitHub Repo: https:// | * GitHub Repo: https:// | ||
Line 32: | Line 33: | ||
<code php> | <code php> | ||
$db = new mysqli(' | $db = new mysqli(' | ||
- | |||
- | $sql = ' | ||
$name = ' | $name = ' | ||
Line 51: | Line 50: | ||
<code php> | <code php> | ||
- | $statement = $db-> | + | $statement = $db-> |
- | $statement-> | + | $statement-> |
$statement-> | $statement-> | ||
Line 63: | Line 62: | ||
<code php> | <code php> | ||
- | $statement = $db-> | + | $statement = $db-> |
$statement-> | $statement-> | ||
Line 74: | Line 73: | ||
<code php> | <code php> | ||
- | foreach ($db-> | + | foreach ($db-> |
print_r($row); | print_r($row); | ||
} | } | ||
Line 108: | Line 107: | ||
==== Returning false ==== | ==== Returning false ==== | ||
- | Because the implementation is effectively calling [[https:// | + | The implementation is effectively calling [[https:// |
+ | |||
+ | ==== Properties ==== | ||
+ | |||
+ | Because [[https:// | ||
+ | |||
+ | - int|string **$affected_rows** - use // | ||
+ | - int|string **$insert_id** - use // | ||
+ | - int|string **$num_rows** - also available on // | ||
+ | - int **$param_count** | ||
+ | - int **$field_count** - also available on // | ||
+ | - int **$errno** - use // | ||
+ | - string **$error** - use // | ||
+ | - array **$error_list** - use // | ||
+ | - string **$sqlstate** - use // | ||
+ | - int **$id** | ||
+ | |||
+ | It's also worth noting the error property usage will hopefully reduce, as more developers use // | ||
==== Re-using Statements ==== | ==== Re-using Statements ==== | ||
- | The implementation discards the // | + | The implementation discards the // |
==== Updating Existing Functions ==== | ==== Updating Existing Functions ==== | ||
- | Cannot change // | + | Cannot change // |
Cannot replace the deprecated // | Cannot replace the deprecated // | ||
Line 156: | Line 172: | ||
===== Open Issues ===== | ===== Open Issues ===== | ||
- | ==== Affected Rows ==== | + | None |
- | + | ||
- | Currently // | + | |
- | + | ||
- | ==== Properties ==== | + | |
- | + | ||
- | Because [[https:// | + | |
- | + | ||
- | - int|string **$affected_rows** - see above | + | |
- | - int|string **$insert_id** - can use // | + | |
- | - int|string **$num_rows** - also available on // | + | |
- | - int **$param_count** | + | |
- | - int **$field_count** - also available on // | + | |
- | - int **$errno** - can use // | + | |
- | - string **$error** - can use // | + | |
- | - array **$error_list** - can use // | + | |
- | - string **$sqlstate** - can use // | + | |
- | - int **$id** | + | |
===== Unaffected PHP Functionality ===== | ===== Unaffected PHP Functionality ===== | ||
Line 187: | Line 186: | ||
Accept the RFC | Accept the RFC | ||
- | TODO | + | <doodle title=" |
+ | * Yes | ||
+ | * No | ||
+ | </ | ||
===== Implementation ===== | ===== Implementation ===== | ||
[[https:// | [[https:// | ||
+ | |||
+ | This implementation copies some details to the mysqli object, but not the affected rows. This means // | ||
===== References ===== | ===== References ===== | ||
Line 199: | Line 203: | ||
===== Rejected Features ===== | ===== Rejected Features ===== | ||
- | TODO | + | None |
rfc/mysqli_execute_query.1650807358.txt.gz · Last modified: 2022/04/24 13:35 by craigfrancis