Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Projects > The Bug Tracker > Bug

Notices

Cannot set friend-based options Issue Tools
issueid=10 04-02-2012 04:16 PM
Administrator, Lead Coder
Cannot set friend-based options
The error message 'Call to a member function fetchObject() on a non-object' is displayed when users try to set friend-based options

As was reported from Tale of Dragon forums, the current Mys v1.3.0 release has a glitch with the friends.php file. This error is generated when users attempt to set friend-based options:

PHP Code:
Fatal errorCall to a member function fetchObject() on a non-object in /home/taleofdr/public_html/friends.php on line 115 
After taking a look into the friends.php, I found that the keyword 'AND' was missing from the query that retrieves database information for friends. This is not a problem for Mys v1.3.1 as the new database class' methods join() and select() takes care of sql queries. But now you see, it is a good idea to implement a database class in a way that it prevents errors in database queries.
Issue Details
Project The Bug Tracker
Category Unknown
Status Fixed
Priority 6
Affected Version Mys v1.3.0
Fixed Version Mys v1.3.1
Users able to reproduce bug 0
Users unable to reproduce bug 0
Assigned Users Hall of Famer
Tags (none)

04-02-2012 04:18 PM
Administrator, Lead Coder
 
To fix this, find the long query string from friends.php file:

PHP Code:
$query "SELECT * FROM {$prefix}users, {$prefix}users_options   
                                          WHERE 
{$prefix}users.username='{$loggedinname}'
                                          
{$prefix}users_options.uid = {$prefix}users.uid
                                          
{$prefix}users_options.username = {$prefix}users.username"
And replace with:

PHP Code:
$query "SELECT * FROM {$prefix}users, {$prefix}users_options   
                                          WHERE 
{$prefix}users.username='{$loggedinname}'
                                          AND 
{$prefix}users_options.uid = {$prefix}users.uid
                                          AND 
{$prefix}users_options.username = {$prefix}users.username"
With the keyword 'AND' in the query, the PDO statement object should be successfully generated, thereby fixing the error.
Reply
Reply

Issue Tools
Subscribe to this issue

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

Currently Active Users: 436 (0 members and 436 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