Right on with that, just thought I'd add confirmation.. basically whenever MySQL would retern Query OK XX rows affected.. its a NULL return. I found this out the harder way, expecting it to be something more complex that I would have to test for..

A good reference for all this stuff is in the MySQL manual, freely downloadable in PDF form (I recommend PDF over html version), and somewhere in there is a whole section dedicated to the C API for MySQL, along with the API for a few other languages I believe. Also the book Mysql from O'Reilly has a good section devoted to the C API and examples.. usually libraries stock those books, atleast mine does.

--
Kevin

Chad Simmons wrote:
--- Tom Whiting <[EMAIL PROTECTED]> wrote:

Breakpoint 2, send_query (command=0xbfff81e0 "SELECT * from stats WHERE
uname = 'Xantha' ")
<<from here it's all downhill.. crash_copyover called as it should be,
game rebooted>>

No, this is the beginning of the crash_copyover code, where it's saving
the sql player stats. It starts going downhill here:

87             if (!(db->result=mysql_store_result(&my_connection)))
89              error_db(command, 2 );


What would you logically expect the result of an insert statement to be? For a
select the result is the list of records returned, but an insert doesn't give
anything like that. I would say that inserting to the database most likely
would return NULL from a mysql_store_result call, which then causes your
program to erroniously error out. You might want to make a different function
which is used for inserts, and which does not look for a result from the
statement.

~Kender



Reply via email to