Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-23-2016, 10:10 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 63,598
Dinocanid is on a distinguished road
Default 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?
__________________
Reply With Quote
  #2  
Old 12-25-2016, 10:43 AM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,155
Hwona is on a distinguished road
Default

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?
__________________
Reply With Quote
  #3  
Old 12-25-2016, 09:04 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 63,598
Dinocanid is on a distinguished road
Default

It is, I didn't realize I was using it though. Thanks for pointing that out! It still doesn't work though.
__________________
Reply With Quote
  #4  
Old 12-25-2016, 10:39 PM
Hwona's Avatar
Hwona Hwona is offline
Member
 
Join Date: Mar 2013
Posts: 620
Gender: Female
Credits: 48,155
Hwona is on a distinguished road
Default

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.
__________________
Reply With Quote
  #5  
Old 12-26-2016, 10:07 AM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 63,598
Dinocanid is on a distinguished road
Default

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:05 AM.

Currently Active Users: 453 (0 members and 453 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636