Implement mysqli_fetch_column#6798
Merged
kamil-tekiela merged 2 commits intophp:masterfrom May 1, 2021
Merged
Conversation
kocsismate
reviewed
Mar 23, 2021
d6e8caf to
243d14f
Compare
Member
|
Accompanying RFC: https://wiki.php.net/rfc/mysqli_fetch_column |
0eb8c61 to
757d1fd
Compare
nikic
reviewed
Apr 14, 2021
ext/mysqli/mysqli.stub.php
Outdated
|
|
||
| function mysqli_fetch_row(mysqli_result $result): array|null|false {} | ||
|
|
||
| function mysqli_fetch_column(mysqli_result $result, int $column = 0): null|int|string|false {} |
Member
There was a problem hiding this comment.
Can't it also return float in INT_AND_FLOAT native mode?
757d1fd to
05ad183
Compare
nikic
approved these changes
Apr 26, 2021
Member
nikic
left a comment
There was a problem hiding this comment.
Looks good (assuming RFC accepted)
2ca3539 to
73969d4
Compare
jrfnl
added a commit
to PHPCompatibility/PHPCompatibility
that referenced
this pull request
Mar 9, 2022
While only the method is mentioned in the RFC and the Migration guide, a procedural version of the same was also implemented. Includes unit tests. Refs: * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.mysqli.mysqli_fetch_column * https://wiki.php.net/rfc/mysqli_fetch_column * php/php-src#6798 * php/php-src@54222a6
jrfnl
added a commit
to jrfnl/doc-en
that referenced
this pull request
Mar 11, 2022
(mentioned in new features, but not in the new functions list) > `mysqli_result::fetch_column()` has been added to allow fetching a single scalar value from the result set. While only the method is mentioned in the RFC and the Migration guide, a procedural version of the same was also implemented. Refs: * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.mysqli.mysqli_fetch_column * https://wiki.php.net/rfc/mysqli_fetch_column * php/php-src#6798 * php/php-src@54222a6
cmb69
pushed a commit
to php/doc-en
that referenced
this pull request
Mar 11, 2022
* PHP 8.1 | MigrationGuide/New functions: add missing functions [1] (mentioned in new features, but not in the new functions list) > GD: > * Avif support is now available through the `imagecreatefromavif()` and > `imageavif()` functions, if libgd has been built with avif support. Refs: * https://github.com/php/php-src/blob/f67986a9218f4889d9352a87c29337a5b6eaa4bd/UPGRADING#L245-L247 * php/php-src#7026 * php/php-src@81f6d36 * PHP 8.1 | MigrationGuide/New functions: add missing functions [2] (mentioned in new features, but not in the new functions list) > `mysqli_result::fetch_column()` has been added to allow fetching a single scalar value from the result set. While only the method is mentioned in the RFC and the Migration guide, a procedural version of the same was also implemented. Refs: * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.mysqli.mysqli_fetch_column * https://wiki.php.net/rfc/mysqli_fetch_column * php/php-src#6798 * php/php-src@54222a6 Co-authored-by: jrfnl <jrfnl@users.noreply.github.com> Closes GH-1448.
tiffany-taylor
pushed a commit
to tiffany-taylor/doc-en
that referenced
this pull request
Jan 16, 2023
* PHP 8.1 | MigrationGuide/New functions: add missing functions [1] (mentioned in new features, but not in the new functions list) > GD: > * Avif support is now available through the `imagecreatefromavif()` and > `imageavif()` functions, if libgd has been built with avif support. Refs: * https://github.com/php/php-src/blob/f67986a9218f4889d9352a87c29337a5b6eaa4bd/UPGRADING#L245-L247 * php/php-src#7026 * php/php-src@81f6d36 * PHP 8.1 | MigrationGuide/New functions: add missing functions [2] (mentioned in new features, but not in the new functions list) > `mysqli_result::fetch_column()` has been added to allow fetching a single scalar value from the result set. While only the method is mentioned in the RFC and the Migration guide, a procedural version of the same was also implemented. Refs: * https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.mysqli.mysqli_fetch_column * https://wiki.php.net/rfc/mysqli_fetch_column * php/php-src#6798 * php/php-src@54222a6 Co-authored-by: jrfnl <jrfnl@users.noreply.github.com> Closes phpGH-1448.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is WIP but I am looking for suggestions to improve.
mixedbetter thannull|int|string|false?This should work almost exactly the same as PDO fetchColumn with the only difference that MySQL doesn't have a boolean type so the function can never return true (it will return false if no more rows are available).