-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Implement mysqli_fetch_column #6798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
kocsismate
reviewed
Mar 23, 2021
d6e8caf
to
243d14f
Compare
0eb8c61
to
757d1fd
Compare
nikic
reviewed
Apr 14, 2021
ext/mysqli/mysqli.stub.php
Outdated
@@ -667,6 +672,8 @@ function mysqli_fetch_object(mysqli_result $result, string $class = "stdClass", | |||
|
|||
function mysqli_fetch_row(mysqli_result $result): array|null|false {} | |||
|
|||
function mysqli_fetch_column(mysqli_result $result, int $column = 0): null|int|string|false {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't it also return float in INT_AND_FLOAT native mode?
757d1fd
to
05ad183
Compare
nikic
approved these changes
Apr 26, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> 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 <[email protected]> Closes phpGH-1448.
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.
mixed
better 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).