fix query
This commit is contained in:
@@ -29,11 +29,10 @@ long WrenchAccountSetPrefrence(CVars in, CVars &out){
|
|||||||
res = pgsql_query("SELECT id,uid FROM members WHERE id = %lu", member_id );
|
res = pgsql_query("SELECT id,uid FROM members WHERE id = %lu", member_id );
|
||||||
|
|
||||||
if (res != NULL && pgsql_num_rows(res) > 0) {
|
if (res != NULL && pgsql_num_rows(res) > 0) {
|
||||||
out["total_record"] = pgsql_num_rows(res);
|
|
||||||
map<const char*, const char*>f = pgsql_fetch_assoc(res,0);
|
map<const char*, const char*>f = pgsql_fetch_assoc(res,0);
|
||||||
CVars rec;
|
CVars rec;
|
||||||
map_to_cvars(f, rec);
|
map_to_cvars(f, rec);
|
||||||
pgsql_query("UPDATE members SET account_pref='%s' WHERE id = %lu AND uid = '%s'", in["user_pref"].c_str() ,in["member_id"].Long(), rec["uid"].c_str());
|
pgsql_query("UPDATE members SET account_pref='%s' WHERE id = %lu AND uid::text = '%s'", in["user_pref"].c_str() ,in["member_id"].Long(), rec["uid"].c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = PHP_API_OK;
|
ret = PHP_API_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user