mysql_fetch_field_direct(3)
π NAME π
mysql_fetch_field_direct β returns a pointer to a MYSQL_FIELD structure. yes bestie that's literally the whole job description π
Oh also hi, this is from the MariaDB Connector/C manual, and it's the mysql_fetch_field_direct(3) page. Putting that up front so you know where you are π«Ά
β¨ SYNOPSIS β¨
#include <mysql.h>
MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES * res,
unsigned int fieldnr);
look at that signature. so clean. so demure. πΈ
π DESCRIPTION π
Okay so here's the vibe: this function hands you back a pointer to a MYSQL_FIELD structure, and that structure is packed with field info from whichever result set you point it at. it's giving "let me tell you everything about this one specific field" energy π
Parameter
resβ a result set identifier, the kind you get back frommysql_store_result(3)ormysql_use_result(3). it's your ticket to the data, bestie ποΈfieldnrβ the field number. and ngl this one has rules: it must be within the range from0to number of fields- 1. off-by-one will absolutely humble you π
Notes
- The total number of fields? you can get that from
mysql_field_count(). that's your cheat code for staying in range π₯
π RETURN VALUE π
A pointer to a MYSQL_FIELD structure π«Ά β¦ or NULL if you specified an invalid field number. so if you get NULL back, that's the universe telling you your fieldnr was not it π
π¦ SEE ALSO π¦
okay that's the whole page, no notes, you ate π β¨
<cute sign-off>this was Version 3.4 of the mysql_fetch_field_direct(3) page from the MariaDB Connector/C manual β go forth and fetch those fields responsibly, bestie ππ§</cute sign-off>
π¦ 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