Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Can't update user status (http://www.mysidiaadoptables.com/forum/showthread.php?t=5311)

Dinocanid 12-23-2016 10:10 PM

Can't update user status
 
I have new columns in my users_status table for user achievements, but I can't seem to update them. I see lines like these in user.php that works for the others:
PHP Code:

$mysidia->db->update("users_status", array("canvm" => 'no'), "uid='{$mysidia->input->get("uid")}'"); 

One of my achievements unlocks when a user has owned a certain number of pets, which I used these lines of code in myadoptsview for:
PHP Code:

$shelfSpace $mysidia->db->select("users", array("shelfspace"), "username = '{$mysidia->user->username}'")->fetchColumn(); 
$adoptAmount $mysidia->db->select("owned_adoptables", array("aid"), "owner = '{$mysidia->user->username}'")->rowCount();
        if(
$adoptamount >= 10){
        
$mysidia->db->update("users_status", array("fullpantry" => 'unlocked'), "username='{$mysidia->input->get("username")}'");
        } 

(located under public function index)

It's supposed to run when the user just visits the page since I wanted to avoid using buttons for this, but it doesn't work and I can't see why. Any ideas?

Hwona 12-25-2016 10:43 AM

Why don't you just use this?:
PHP Code:

 $mysidia->db->update("users_status", array("fullpantry" => 'unlocked'), "username='{$mysidia->user->username}'"); 

Isn't $mysidia->input->get("username") normally used to collect an input from a form?

Dinocanid 12-25-2016 09:04 PM

It is, I didn't realize I was using it though. Thanks for pointing that out! It still doesn't work though.

Hwona 12-25-2016 10:39 PM

Umm, I can't figure out what's wrong, but why don't you try printing out value for $adoptAmount to see if the value is correct.

Dinocanid 12-26-2016 10:07 AM

Found out what was wrong. I was using adoptamount in the database update instead of adoptAmount like it should be >_<


All times are GMT -5. The time now is 07:44 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.