OK. I've got compile and link with mysql. I connected to the database.
if you use mysql_affected_rows(&mysql) after a select, it returns a
non-zero value even if 0 rows were returned.
You actually have to try to fetch the row before you find out no data
was selected. The documentation says you find the number of rows
retrieved by the select. I think this is a bug.
If you use mysql_store_result(), you can use mysql_num_rows() and find
out no rows were affected.
However, if you use mysql_num_rows() before calling mysql_use_result()
you get a segmentation fault. This was not mentioned in the documentation
as causing a segmentation fault.