Issues encountered by SQLite

Source: Internet
Author: User
Tags sqlite

#define UPDATE_PROPINFO_SQL "UPDATE" user_prop_table "SET" player_props "= '%s ' WHERE id =%d;"
#define DEFAULT_PLAYER_ID 1

The following method has always reported grammatical errors, making people very mad.

int Player::updatepropinfo ()
{
char* sql = sqlite3_mprintf (Update_propinfo_sql,getpropstimestr (). C_STR (), default_player_id);
string retstr = SQL;
Sqlite3_free (SQL);
return gsqlite3->exec (SQL, RETSTR);
}

String Player::getpropstimestr ()
{
String propstimestr = "";
for (int i = 0; i < m_propstimes.size (); i++)
{
Char temp[64] = {0};
sprintf (temp, "%d", m_propstimes[i]);
Propstimestr.append (temp);
if (I < (M_propstimes.size ()-1))
{
Propstimestr.append (","); TIP: This space cannot be saved
}
}
Propstimestr.append ("");
return propstimestr;
}

Vector<int> M_propstimes; An array of the number of props stacked

Finally found in the top of the Propstimestr.append (","); the space in front of the comma is not written, the space pits the dead.

Issues encountered by SQLite

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.