2019-06-17, 12:58 AM
Long story short, my site has some custom code that adds currency to users upon posting (PHP in the /inc/datahandlers/post.php file). That works properly. Likewise, there's custom code in the /admin/modules/user/users.php file that allows admins to see and edit this currency field in the Admin CP.
Sadly upon upgrade some of this was lost and I'm trying to piece it back together. Everything works perfectly, except this field "Gemstones" being updated via Admin CP.
In the users.php file I have this code:
Is this correct/should this work to update that DB field properly? I see it, but it doesn't actually seem to edit. If yes, is there some other file I'm missing somewhere that needs to be edited?
Sorry if this makes no sense, I'm not the one who wrote this code and am kind of panicking.. thanks for any help!!!
Sadly upon upgrade some of this was lost and I'm trying to piece it back together. Everything works perfectly, except this field "Gemstones" being updated via Admin CP.
In the users.php file I have this code:
Quote:// Update user gemstones count
$query = $db->simple_select("users", "gemstones", "uid='".$destination_user['uid']."'");
$num = $db->fetch_array($query);
$updated_count = array(
"gemstones" => $num['gemstones']
);
$db->update_query("users", $updated_count, "uid='{$destination_user['uid']}'");
Is this correct/should this work to update that DB field properly? I see it, but it doesn't actually seem to edit. If yes, is there some other file I'm missing somewhere that needs to be edited?
Sorry if this makes no sense, I'm not the one who wrote this code and am kind of panicking.. thanks for any help!!!