Welcome Guest, Not a member yet? Register   Sign In
news category and subcategory
#3

the below code gives error
Code:
Error Number: 1052

Column 'cat_id' in where clause is ambiguous

SELECT * FROM (`news`) JOIN `cat` ON `news`.`cat_id` = `cat`.`cat_id` WHERE `cat_id` = '1' OR `parent_id` = '1'

Filename: C:\wamp\www\toyda\system\database\DB_driver.php

Line Number: 330





PHP Code:
$query $this->db->from("news")
                ->
join("cat""news.cat_id = cat.cat_id")
                ->
where("cat_id""1")
                ->
or_where("parent_id""1")
                ->
get();      
  return 
$query->result(); 
Reply


Messages In This Thread
news category and subcategory - by paju89 - 12-10-2014, 05:14 AM
RE: news category and subcategory - by _this - 12-10-2014, 07:32 AM
RE: news category and subcategory - by paju89 - 12-10-2014, 08:57 AM
RE: news category and subcategory - by paju89 - 12-10-2014, 08:47 AM
RE: news category and subcategory - by _this - 12-10-2014, 08:59 AM
RE: news category and subcategory - by paju89 - 12-10-2014, 09:04 AM
RE: news category and subcategory - by _this - 12-10-2014, 12:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB