Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 07-12-2011, 04:11 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Things to be aware of if you do want to read the database directly:

if database.RunQuery returns false, your DatasetResult will be NULL, i.e. invalid, so all you should do is send some debugging info to the zone log,
free the query if you allocated the memory with MakeAnyLenString, and then bail out, e.g.:
Code:
printf("Query: %s failed with error %s\n", Query, TempErrorMessageBuffer);
fflush(stdout);
safe_delete_array(Query);
return;
Also, if the query is successful, it can still return zero rows, so you need to call mysql_num_rows(DatasetResult) and check it is >0 before calling mysql_fetch_row(),
and/or check mysql_fetch_row() doesn't return NULL when you call it before attempting to process the returned row.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:15 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3