Jump to content
  • 0
Sign in to follow this  
pedrodks

SQL HANDLE CORRECT

Question

Thanks Guys? How are you

 

I'm in doubt on how to select the pet_id value from the pet table in the mysql database using a unique_id value in (uint32) that I insert into the table.

 

my function:

 

int pet_evo_start(uint32 unique_id)
{
    char* sql_data;
    int pet_id;

    if (SQL_ERROR == SQL_Query(map_mysql_handle, "SELECT `pet_id` FROM `pet` WHERE `unique_id` = '%u'", unique_id))
    {
        Sql_ShowDebug(map_mysql_handle);
    }
    SQL_GetData(map_mysql_handle, 0, &sql_data, NULL);
    pet_id = strtoul(sql_data, NULL, 10);
    SQL_FreeResult(map_mysql_handle);
    return pet_id;
}

i'm obtain crash on map_server with the following question

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.