Database_Exception [ 1064 ]: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY `assignment`, `category`' at line 23 [ SELECT `products`.`id`, `products`.`name`, `products`.`short_specification`, `products`.`alias`, `products`.`category_id`, `products`.`assignment_id`, `products`.`brand_id`, `products`.`hit`, (SELECT `categories`.`name` FROM `categories` WHERE `categories`.`id` = `products`.`category_id`) AS `category`, (SELECT `categories`.`alias` FROM `categories` WHERE `categories`.`id` = `products`.`category_id`) AS `category_alias`, (SELECT `assignments`.`name` FROM `assignments` WHERE `assignments`.`id` = `products`.`assignment_id`) AS `assignment`, (SELECT `assignments`.`alias` FROM `assignments` WHERE `assignments`.`id` = `products`.`assignment_id`) AS `assignment_alias`, (SELECT `brands`.`name` FROM `brands` WHERE `brands`.`id` = `products`.`brand_id`) AS `brand`, (SELECT `brands`.`alias` FROM `brands` WHERE `brands`.`id` = `products`.`brand_id`) AS `brand_alias`, (SELECT `prices`.`price` FROM `prices` WHERE `prices`.`product_id` = `products`.`id` AND `prices`.`main` = 'yes' LIMIT 1) AS `price`, (SELECT `product_images`.`name` FROM `product_images` WHERE `product_images`.`product_id` = `products`.`id` LIMIT 1) AS `image` FROM `products` WHERE `products`.`public` = 'yes' AND `products`.`brand_id`= ORDER BY `assignment`, `category` ]

MODPATH/database/classes/Kohana/Database/MySQL.php [ 194 ]

189 			{
190 				// This benchmark is worthless
191 				Profiler::delete($benchmark);
192 			}
193 
194 			throw new Database_Exception(':error [ :query ]',
195 				array(':error' => mysql_error($this->_connection), ':query' => $sql),
196 				mysql_errno($this->_connection));
197 		}
198 
199 		if (isset($benchmark))
  1. MODPATH/database/classes/Kohana/Database/Query.php [ 251 ] » Kohana_Database_MySQL->query(arguments)

  2. APPPATH/classes/Controller/Brands.php [ 149 ] » Kohana_Database_Query->execute()

  3. APPPATH/classes/Controller/Brands.php [ 98 ] » Controller_Brands->productlist(arguments)

  4. SYSPATH/classes/Kohana/Controller.php [ 84 ] » Controller_Brands->action_product()

  5. {PHP internal call} » Kohana_Controller->execute()

  6. SYSPATH/classes/Kohana/Request/Client/Internal.php [ 97 ] » ReflectionMethod->invoke(arguments)

  7. SYSPATH/classes/Kohana/Request/Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request(arguments)

  8. SYSPATH/classes/Kohana/Request.php [ 986 ] » Kohana_Request_Client->execute(arguments)

  9. DOCROOT/index.php [ 124 ] » Kohana_Request->execute()

Environment