mysql_fetch_field(3)
π NAME π
mysql_fetch_field β bestie, this one hands you the definition of exactly one column of a result set. One. At a time. We're doing this slowly and we're doing it right. β¨
πΈ SYNOPSIS πΈ
#include <mysql.h>
MYSQL_FIELD * mysql_fetch_field(MYSQL_RES * result);
π¦ DESCRIPTION π¦
Okay so picture this: you got a result set, and you wanna know what's in it β like, what are these columns, who are they, what's their whole deal. mysql_fetch_field gives you the definition of one column of that result set, and it gives it to you as a pointer to a MYSQL_FIELD structure. π
And the way you use it? You literally just call it over and over again, and each call serves you the next column's info, until you've collected the whole set. It's giving "one fry at a time" energy and honestly? We respect the process. π
π PARAMETERS π
resultβ a result set identifier, and it has to be one you got back frommysql_store_result(3)ormysql_use_result(3). No random pointers, bestie, we need the real thing. π
π NOTES π
- The field order will be reset if you execute a new
SELECTquery. So like, if you start a freshSELECT, don't expect to pick up where you left off β the lineup gets shuffled back to the start. π - If you only need the info for one specific field, don't sit there looping like a main character with too much free time. You can select that field directly with the
mysql_field_seek(3)function, or just grab it withmysql_fetch_field_direct(3). Efficient queen behavior. π
β¨ RETURN VALUE β¨
A pointer to a MYSQL_FIELD structure. π«Ά
Or NULL if there are no more fields left β that's your lil signal that you've reached the end of the lineup, so stop calling it, it has nothing left to give you. π
π₯ SEE ALSO π₯
mysql_field_seek(3)mysql_field_tell(3)mysql_fetch_field_direct(3)mysql_store_result(3)mysql_use_result(3)
And that's the whole page, periodt. π This was Version 3.4 of the MariaDB Connector/C manual, and yeah β the footer said mysql_fetch_field(3) too, we're just folding that in here so you know exactly which page you're on. Go forth and fetch those fields, icon. π§
π¦ where this page comes from
- alpine 3.22: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.23: mariadb-doc 11.4.13-r0 Β· GPL-2.0-or-later
- alpine 3.24: mariadb-doc 11.8.9-r0 Β· GPL-2.0-only
- arch rolling: mariadb 13.0.2-2 Β· GPL-2.0-only
- arch rolling: mariadb-lts 12.3.3-2 Β· GPL-2.0-only
- centos-stream 10: mariadb-connector-c-doc 3.4.4-2.el10 Β· LGPL-2.1-or-later
- debian trixie: libmariadb-dev 1:11.8.6-0+deb13u1 Β· GPL-2.0-only
- fedora 43: mariadb-connector-c-doc 3.4.5-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 43: mariadb-connector-c-doc 3.4.9-2.fc43 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- fedora 44: mariadb-connector-c-doc 3.4.8-3.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01
- fedora 44: mariadb-connector-c-doc 3.4.9-2.fc44 Β· LGPL-2.1-or-later AND PHP-3.0 AND PHP-3.01 AND LicenseRef-Fedora-Public-Domain
- nixpkgs unstable: mariadb-server 11.8.8
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libmariadb-devel 3.4.9-160000.1.1 Β· LGPL-2.1-or-later
- ubuntu questing: libmariadb-dev 1:11.8.3-1build1
- ubuntu resolute: libmariadb-dev 1:11.8.6-5 Β· GPL-2.0-only
- ubuntu resolute: libmariadb-dev 1:11.8.6-5ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libmariadb-dev 1:11.8.9+ds-4ubuntu2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms