I keep getting an warning that num_fields makes a pointer from integer without a cast, but wouldn't mysql_num_fields() return an integer? And let me take this moment to whine about the lack of a mysql_fetch_array or mysql_fetch_assoc in the C API...

Rereading my question should I be assigning results to something other than an int?

So, quite obviously, your results variable is of the wrong type. This may well compile and actually might well work on some platforms (where pointers have the same size as ints) but it's to be avoided. It'd take a good look at the example in the manual page I linked to and correct your code.

You're missing a call in there. You can't take the return value from mysql_query() and feed it into mysql_num_fields(). mysql_query() returns an int, which is simply an indication of whether your query succeeded or failed. mysql_num_fields actually wants a structure pointer to the results themselves. You need to fetch those first with mysql_store_result().