SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member ListsID's Avatar
    Join Date
    Sep 2013
    Posts
    8
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Unhappy An error while installing a pluging for my website! any experts here pleaaaaase help!

    Hello There,I am new in here just Joined the forum, well my problem is I am using Flynax software, I have installed a plugin and got this error message while loading my website:

    PHP Code:
    MYSQL ERROR
    Error
    :    Undeclared variablesale
    Query
    :    SELECT DISTINCT SUBSTRING_INDEX(GROUP_CONCAT(DISTINCT `T6`.`ThumbnailORDER BY `T6`.`TypeDESC, `T6`.`IDASC), ','1) AS `Main_photo`, `T1`.*, `T4`.`Path`, `T4`.`Parent_ID`, `T4`.`Type` AS `Listing_typeFROM `fl_listings` AS `T1LEFT JOIN `fl_listing_plans` AS `T2ON `T1`.`Featured_ID` = `T2`.`IDLEFT JOIN `fl_listing_plans` AS `T3ON `T1`.`Plan_ID` = `T3`.`IDLEFT JOIN `fl_categories` AS `T4ON `T1`.`Category_ID` = `T4`.`IDLEFT JOIN `fl_listing_photos` AS `T6ON `T1`.`ID` = `T6`.`Listing_IDLEFT JOIN `fl_accounts` AS `T7ON `T1`.`Account_ID` = `T7`.`IDWHERE UNIX_TIMESTAMP(DATE_ADD(`T1`.`Featured_date`, INTERVAL `T2`.`Listing_periodDAY)) > UNIX_TIMESTAMP(NOW()) OR `T2`.`Listing_period` = ) AND ( UNIX_TIMESTAMP(DATE_ADD(`T1`.`Pay_date`, INTERVAL `T3`.`Listing_periodDAY)) > UNIX_TIMESTAMP(NOW()) OR `T3`.`Listing_period` = ) AND `T4`.`Type` = 'sale_rent' AND `T1`.`Status` = 'active' AND `T4`.`Status` = 'active' AND `T7`.`Status` = 'active' GROUP BY `T1`.`IDORDER BY `Last_showASCRAND() LIMIT sale
    Function:    eval
    File:    /includes/classes/rlHook.class.php (line# 121) 
    Anyone can please help me urgently ??

  2. #2
    SitePoint Addict bronze trophy Hall of Famer's Avatar
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    370
    Mentioned
    6 Post(s)
    Tagged
    2 Thread(s)
    This error shows that you have an undeclared variable called sale, here is the source of your problem:

    PHP Code:
    LIMIT sale 
    Are you sure its not supposed to be $sale? Or is sale some kind of constants(in this case it can be SALE, I assume capitalized letter notation for PHP constants) or database internal variables?

  3. #3
    SitePoint Member ListsID's Avatar
    Join Date
    Sep 2013
    Posts
    8
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your quick reply, well am not an expert but, I will copy and paste the whole php page here hope this can explain something to you and help me

    Code:
    <?php
    
    /******************************************************************************
     *
     *	
     *
     ******************************************************************************/
    
    class rlHook extends reefless
    {
    	/**
    	* @var validator class object
    	**/
    	var $rlValid;
    	
    	/**
    	* @var common class object
    	**/
    	var $rlCommon;
    	
    	/**
    	* @var hooks array
    	**/
    	var $rlHooks;
    	
    	/**
    	* class constructor
    	**/
    	function rlHook()
    	{
    		global $rlValid, $rlCommon;
    		
    		$this -> rlValid = $rlValid;
    		$this -> rlCommon = $rlCommon;
    		
    		/* get hooks */
    		$this -> getHooks();
    	}
    
    	/**
    	* get all active hooks
    	*
    	* @return array - hooks array
    	**/
    	function getHooks()
    	{
    		$this -> setTable('hooks');
    		$tmp_hooks = $this -> fetch( array('Name', 'Code'), array('Status' => 'active') );
    		$this -> resetTable();
    		
    		foreach ($tmp_hooks as $key => $value)
    		{
    			if (!$hooks[$tmp_hooks[$key]['Name']])
    			{
    				$hooks[$tmp_hooks[$key]['Name']] = $tmp_hooks[$key]['Code'];
    			}
    			else
    			{
    				$tmp_hook = $hooks[$tmp_hooks[$key]['Name']];
    				
    				unset($hooks[$tmp_hooks[$key]['Name']]);
    				
    				if (is_array($tmp_hook))
    				{
    					$tmp_hook[] = $tmp_hooks[$key]['Code'];
    					$hooks[$tmp_hooks[$key]['Name']] = $tmp_hook;
    				}
    				else
    				{
    					$hooks[$tmp_hooks[$key]['Name']][] = $tmp_hooks[$key]['Code'];
    					$hooks[$tmp_hooks[$key]['Name']][] = $tmp_hook;
    				}
    			}
    			unset($tmp_hook);
    		}
    
    		unset($tmp_hooks);
    		$this -> rlHooks = $hooks;
    		$GLOBALS['hooks'] = $hooks;
    	}
    	
    	/**
    	* load hook
    	*
    	* @param string - hook name
    	*
    	**/
    	function load( $name = false )
    	{
    		if ( is_array($name) )
    		{
    			$name = $name['name'];
    			$hooks = $GLOBALS['hooks'];
    		}
    		else
    		{
    			$hooks = $this -> rlHooks;
    		}
    
    		$code = $hooks[$name];
    		if ( !empty($code) )
    		{
    			if (is_array($code))
    			{
    				foreach ($code as $item)
    				{
    					eval($item);
    				}
    			}
    			else
    			{
    				eval($code);
    			}
    		}
    	}
    }
    Line 121 means : eval($item);

  4. #4
    SitePoint Addict bronze trophy Hall of Famer's Avatar
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    370
    Mentioned
    6 Post(s)
    Tagged
    2 Thread(s)
    I don't think the error lies in the code you posted above, there's nothing wrong with the eval() method, the item variable contains incorrect/non-executable PHP code and that's the root of your problem. The error message may say line 121 in your class file, but you need to examine the item variable to debug.

    Apparently it has something to do with the creation/generation of SQL query, but it's not found in the class file you posted. Did you post the entire class? Where is the fetch() method? Is it responsible for generating the limit clause in your SQL query?

  5. #5
    SitePoint Member ListsID's Avatar
    Join Date
    Sep 2013
    Posts
    8
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes, I have copied and pasted the whole code of the php page mentioned on the error message!
    I just can't understand what ''sale'' means it's not even on the php code! fetch() method? I don't know really!
    what do you suggest me to do? the plugin I was trying to install is called ''Listings_carousel'' !

  6. #6
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,222
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    Get a hold of the developer of that plugin (that's where I'd start).

  7. #7
    SitePoint Addict bronze trophy Hall of Famer's Avatar
    Join Date
    Apr 2013
    Location
    Ithaca
    Posts
    370
    Mentioned
    6 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by ListsID View Post
    Yes, I have copied and pasted the whole code of the php page mentioned on the error message!
    I just can't understand what ''sale'' means it's not even on the php code! fetch() method? I don't know really!
    what do you suggest me to do? the plugin I was trying to install is called ''Listings_carousel'' !
    As cpradio said, you'd better consult the developer for this problem you encountered. It seems that the SQL query aint constructed properly, this may as well be a bug within the plugin. In this case, its your best interest to ask the developers to resolve such glitches, unless it is already a legacy code that no one will bother fixing its glitches.

  8. #8
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,222
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    @ListsID ; Don't get us wrong, we'd be glad to help, but it will take us ages to get through this issue with you (post after post after post). If you can't get a hold of the plugin developer, please do come back to this thread and say so. We can go through the process, but to be honest, we'd be doing a lot of guessing until we can start to identify 1) how this plugin system works, 2) what the plugin is intending to do, and 3) how the table structure is built and interacts with everything.

    That's a lot to try and collect/identify and it could take us a long while before we get there (only to find out, we barked up the wrong tree and have to start all over).

  9. #9
    SitePoint Member ListsID's Avatar
    Join Date
    Sep 2013
    Posts
    8
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Thank Guys for your explanations !


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •