Post by madaha » Fri Jan 18, 2008 3:16 pm

how to slove this problem? Looking for help.

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm

Post by bruce » Sat Jan 19, 2008 2:33 pm

It is an error in the sql statement.

change catalog\controller\search.php as shown. It is a one line change but I have shown more code to help you locate it. The original line is commented. Replace it with the line below.

Code: Select all

      		if (!$session->get('search.description')) {
        		$sql = "select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where pd.language_id = '?' and pd.name like '?' and p.date_available < now() and p.status = '1'";
				
				$results = $database->getRows($database->splitQuery($database->parse($sql, $language->getId(), '%' . $session->get('search.search') . '%'), $session->get('search.page'), $config->get('config_max_rows')));
      		} else { 
                // $sql = "select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where pd.language_id = '?' and pd.name like '?' or pd.description like '?' and p.date_available < now() and p.status = '1'";
                // ** replace the above line with the following line
                $sql = "select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where pd.language_id = '?' and (pd.name like '?' or pd.description like '?') and p.date_available < now() and p.status = '1'";
				
				$results = $database->getRows($database->splitQuery($database->parse($sql, $language->getId(), '%' . $session->get('search.search') . '%', '%' . $session->get('search.search') . '%'), $session->get('search.page'), $config->get('config_max_rows')));
      		}

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by madaha » Sun Jan 20, 2008 1:02 pm

Problem sloved ! Thank you so much !

New member

Posts

Joined
Thu Sep 06, 2007 6:02 pm
Who is online

Users browsing this forum: No registered users and 2 guests