mysql_field_seek(3)

πŸ“¦
version 13.0.2 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ mysql_field_seek ✨

okay bestie, welcome to the MariaDB Connector/C manual, section 3 πŸŽ€ this one's about mysql_field_seek and it's literally the "jump to that column, bestie" function, no cap.


🌸 Name 🌸

mysql_field_seek β€” sets the field cursor to given offset πŸ’…


πŸ¦‹ Synopsis πŸ¦‹

#include <mysql.h>

MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES * result,
                                    MYSQL_FIELD_OFFSET offset);

πŸ’– Description πŸ’–

So here's the vibe: mysql_field_seek sets the field cursor to the given offset. That's it, that's the whole job, and it ate. πŸ‘‘

And the payoff? The next call to mysql_fetch_field(3) will retrieve the field definition of the column associated with that offset. So you're basically telling the cursor "girl, go stand over there" and then the next fetch serves you exactly that column's field definition. iconic behaviour honestly 🌟


πŸŽ€ Parameters πŸŽ€

  • result β€” a result set identifier returned by mysql_store_result(3) or mysql_use_result(3). it's the whole result set babe, you gotta hand it over 🫢
  • offset β€” the field number. and listen, this number must be in the range from 0..number of fields - 1. color inside the lines or it's giving chaos 😭

πŸ’… Notes πŸ’…

  • The number of fields can be obtained from mysql_field_count(3). use it, bestie, don't guess πŸ’€
  • To move the field cursor to the first field, the offset parameter should be zero. first field, zero offset, that's the rule 🌈

⭐ Return value ⭐

Returns the previous value of the field cursor. yes, the old one, not the new one β€” she remembers where you were before you moved, and that's on main character energy πŸ‘‘


πŸ”₯ See also πŸ”₯


Version 3.4 of the MariaDB Connector/C man pages, and that's a wrap bestie πŸ’œ mwah, go forth and seek those fields, you absolute Unix icon 🧚✨

πŸ“¦ where this page comes from