Jump to content
  • 0

SQL HANDLE CORRECT


pedrodks

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   1
  • Joined:  04/05/14
  • Last Seen:  

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

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  4
  • Reputation:   1
  • Joined:  04/05/14
  • Last Seen:  

up

 

Link to comment
Share on other sites

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.

×
×
  • Create New...