mysql_more_results(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_more_results πŸ’–

okay bestie, welcome to the MariaDB Connector/C section of the manual, and today's main character is mysql_more_results β€” the lil function that tells you if there's more waiting for you. she's giving "is that all?" but in C. ✨


🌸 NAME 🌸

mysql_more_results β€” indicates if one or more results are available

like, is there more tea to spill or are we done here? that's literally her whole job. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <mysql.h>

my_bool mysql_more_results(MYSQL * mysql);

yes, that's it. one line, one arg, no drama. she's low maintenance and we love that for her. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

Indicates if one or more result sets are available from a previous call to mysql_real_query(3).

so like β€” you already ran mysql_real_query(3), right? and now you're sitting there wondering if the server sent back more than one result set. that's the vibe check this function runs. it peeks at the situation and tells you whether there are one or more result sets still hanging out, waiting for you to come get them. no cap. 🌈


⭐ PARAMETER ⭐

so you can't just roll up with a random pointer, bestie 😭 that connection needs to have been born via mysql_init(3) and then actually connected with mysql_real_connect(3) first. it's giving "papers, please". πŸŽ€


✨ NOTES ✨

so if you're out here wondering why you're not getting multiple result sets... check that setting first, bestie. mysql_set_server_option(3) is the switch that turns multi statement support on and off. no switch, no multi. it's that simple. πŸ™ˆ
  • Multiple result sets can be obtained either by calling a stored procedure or by executing concatenated statements, e.g. SELECT a FROM t1;SELECT b, c FROM t2.

so there's two ways to end up with a whole stack of result sets instead of just one: call a stored procedure, or execute concatenated statements. like this, for example:

SELECT a FROM t1;SELECT b, c FROM t2

two statements, one string, two result sets. iconic behaviour honestly. πŸ”₯


πŸ‘‘ RETURN VALUE πŸ‘‘

Returns 1 if more result sets are available, otherwise zero.

so: 1 = bestie there's more πŸ’–, 0 = that's all, we're done here. super simple, super clean, no weird error codes to decode. periodt.


🌸 SEE ALSO 🌸

go read those too, they're literally her besties and they all work together. iykyk. πŸ’œ


Version 3.4 of the MariaDB Connector/C manual, and that's the whole page bestie β€” mysql_more_results says goodnight πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from