- problem: DB Error: no such field --> SELECT DISTINCT `stock`.`stock_uid`,
 `stock`.`stock_name`,
 `stock`.`reference`,
 `stock`.`period_uid`,
 `stock`.`maker_uid`,
 `stock`.`place_uid`,
 `stock`.`style_uid`,
 `stock`.`year`,
 `stock`.`circa`,
 `stock`.`dimensions`,
 `stock`.`weight`,
 `stock`.`condition`,
 `stock`.`saleprice`,
 `stock`.`costprice`,
 `stock`.`comment`,
 `stock`.`meta_keywords`,
 `stock`.`status_uid`,
 UNIX_TIMESTAMP(`stock`.`timestamp`) as `timestamp`,
 UNIX_TIMESTAMP(`stock`.`created`) as `created`,
 UNIX_TIMESTAMP(`stock`.`available`) as `available`,
 UNIX_TIMESTAMP(`stock`.`datesold`) as `datesold`
FROM (((((((`stock`, `stock_category_link`) LEFT JOIN `period` AS s_period ON (`stock`.`period_uid`=`s_period`.`period_uid`))  LEFT JOIN `maker` AS s_maker ON (`stock`.`maker_uid`=`s_maker`.`maker_uid`))  LEFT JOIN `place` AS s_place ON (`stock`.`place_uid`=`s_place`.`place_uid`))  LEFT JOIN `style` AS s_style ON (`stock`.`style_uid`=`s_style`.`style_uid`))  LEFT JOIN `stock_category_link` AS l_stock_category_link ON (`l_stock_category_link`.`stock_uid`=`stock`.`stock_uid`))  LEFT JOIN `category` AS l_category ON (`l_stock_category_link`.`category_uid`=`l_category`.`category_uid`)) WHERE stock_category_link.stock_uid = stock.stock_uid  AND stock_category_link.category_uid = metadata  AND stock.status_uid IN (1,3,4,6)  AND CONCAT(IFNULL(CAST(`stock`.`stock_name` AS CHAR),''), IFNULL(CAST(`stock`.`reference` AS CHAR),''), IFNULL(CAST(`s_period`.`period_name` AS CHAR),''), IFNULL(CAST(`s_maker`.`maker_name` AS CHAR),''), IFNULL(CAST(`s_place`.`place_name` AS CHAR),''), IFNULL(CAST(`s_style`.`style_name` AS CHAR),''), IFNULL(CAST(`stock`.`year` AS CHAR),''), IFNULL(CAST(`stock`.`saleprice` AS CHAR),''), IFNULL(CAST(`stock`.`comment` AS CHAR),''), IFNULL(CAST(`l_category`.`category_name` AS CHAR),'')) LIKE '%%'  order by `datesold`, `available` DESC, `created` DESC LIMIT 0,20 [nativecode=1054 ** Unknown column 'metadata' in 'where clause']
 
	- problem: DB Error: no such field --> SELECT DISTINCT COUNT(DISTINCT `stock`.`stock_uid`)
FROM (((((((`stock`, `stock_category_link`) LEFT JOIN `period` AS s_period ON (`stock`.`period_uid`=`s_period`.`period_uid`))  LEFT JOIN `maker` AS s_maker ON (`stock`.`maker_uid`=`s_maker`.`maker_uid`))  LEFT JOIN `place` AS s_place ON (`stock`.`place_uid`=`s_place`.`place_uid`))  LEFT JOIN `style` AS s_style ON (`stock`.`style_uid`=`s_style`.`style_uid`))  LEFT JOIN `stock_category_link` AS l_stock_category_link ON (`l_stock_category_link`.`stock_uid`=`stock`.`stock_uid`))  LEFT JOIN `category` AS l_category ON (`l_stock_category_link`.`category_uid`=`l_category`.`category_uid`)) WHERE stock_category_link.stock_uid = stock.stock_uid  AND stock_category_link.category_uid = metadata  AND stock.status_uid IN (1,3,4,6)  AND CONCAT(IFNULL(CAST(`stock`.`stock_name` AS CHAR),''), IFNULL(CAST(`stock`.`reference` AS CHAR),''), IFNULL(CAST(`s_period`.`period_name` AS CHAR),''), IFNULL(CAST(`s_maker`.`maker_name` AS CHAR),''), IFNULL(CAST(`s_place`.`place_name` AS CHAR),''), IFNULL(CAST(`s_style`.`style_name` AS CHAR),''), IFNULL(CAST(`stock`.`year` AS CHAR),''), IFNULL(CAST(`stock`.`saleprice` AS CHAR),''), IFNULL(CAST(`stock`.`comment` AS CHAR),''), IFNULL(CAST(`l_category`.`category_name` AS CHAR),'')) LIKE '%%'  [nativecode=1054 ** Unknown column 'metadata' in 'where clause']
 
 
 |  
 
  |