mina Posted November 4, 2017 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 27 Reputation: 2 Joined: 10/25/13 Last Seen: November 16, 2024 Share Posted November 4, 2017 (edited) Hello everyone, my English is not good, Sorry! I gonna add a 'SQL Command' source if (SQL_ERROR == Sql_Query(mmysql_handle, "INSERT INTO `acc_reg_num`(`account_id`, `key`, `index`, `value`) VALUES ('%d,%s,%u,%d')", acc_reg_num_table, sd->status.account_id, "#bonuspoint", '0', value)) Sql_ShowDebug(mmysql_handle); but, it crashes when executed. How can I solve it ? thanks guys! I have solved it myself Edited November 12, 2017 by mina Quote Link to comment Share on other sites More sharing options...
0 Psychonaut Posted November 7, 2017 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 11 Reputation: 3 Joined: 11/07/17 Last Seen: November 28, 2017 Share Posted November 7, 2017 (edited) Can try something like this if (Sql_Query(mmysql_handle, "INSERT INTO `acc_reg_num`(`account_id`, `key`, `index`, `value`) VALUES ('%d','%s','%u','%d');", acc_reg_num_table, sd->status.account_id, "#bonuspoint", '0') != SQL_SUCCESS) Sql_ShowDebug(mmysql_handle); Edited November 7, 2017 by Psychonaut Quote Link to comment Share on other sites More sharing options...
0 Gildeon Silva Posted January 7, 2020 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 5 Reputation: 1 Joined: 06/12/17 Last Seen: June 10, 2021 Share Posted January 7, 2020 Could post as resolved! Quote Link to comment Share on other sites More sharing options...
-1 mina Posted November 12, 2017 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 27 Reputation: 2 Joined: 10/25/13 Last Seen: November 16, 2024 Author Share Posted November 12, 2017 (edited) On 2017/11/7 at 6:20 PM, Psychonaut said: Can try something like this if (Sql_Query(mmysql_handle, "INSERT INTO `acc_reg_num`(`account_id`, `key`, `index`, `value`) VALUES ('%d','%s','%u','%d');", acc_reg_num_table, sd->status.account_id, "#bonuspoint", '0') != SQL_SUCCESS) Sql_ShowDebug(mmysql_handle); i tried it~ But the error message pops up : DB error - Duplicate entry '2000000-#bonuspoint-0' for key 'PRIMARY' thanks guys! I have solved it myself Edited November 12, 2017 by mina Quote Link to comment Share on other sites More sharing options...
Question
mina
Hello everyone, my English is not good, Sorry!
I gonna add a 'SQL Command' source
if (SQL_ERROR == Sql_Query(mmysql_handle, "INSERT INTO `acc_reg_num`(`account_id`, `key`, `index`, `value`) VALUES ('%d,%s,%u,%d')", acc_reg_num_table, sd->status.account_id, "#bonuspoint", '0', value)) Sql_ShowDebug(mmysql_handle);
but, it crashes when executed.
How can I solve it ?
thanks guys!
I have solved it myself
Edited by minaLink to comment
Share on other sites
3 answers 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.