A PHP Error was encountered

Severity: Notice

Message: Undefined variable: cate

Filename: controllers/Commodity_leads.php

Line Number: 60

Backtrace:

File: /home/usercommodity/public_html/application/controllers/Commodity_leads.php
Line: 60
Function: _error_handler

File: /home/usercommodity/public_html/index.php
Line: 292
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/usercommodity/public_html/system/core/Exceptions.php:272)

Filename: core/Common.php

Line Number: 568

Backtrace:

File: /home/usercommodity/public_html/application/models/newb2b/B2b_ui_commodity_leads_model.php
Line: 118
Function: query

File: /home/usercommodity/public_html/application/controllers/Commodity_leads.php
Line: 60
Function: get_leads_recomm_restcat

File: /home/usercommodity/public_html/index.php
Line: 292
Function: require_once

Database Error

A Database Error Occurred

Error Number: 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 'and a.`comm_id`!=157 AND a.`leads_id`!=4939 AND a.`status` =1 AND c.status=1 ' at line 10

SELECT f.b2b_subs_id,a.`leads_id`,a.`packaging_type`,a.`organic`,a.`packaging_size`,a.`quality`,a.`imported`,a.company_name, f.b2b_subs_mob as mobile_number,a.`comm_id`,a.lead_quantity,a.`created_date`, a.`leads_action` , c.comm_name, desk_image_path AS image_path, c.comm_image AS defimage, a.`lead_description` , a.`lead_country` , a.`lead_state` , a.`lead_price` , a.`lead_maxprice` , a.`lead_unit` , e.unit_name, f.b2b_subs_name,a.`lead_owner`,s.`cate_name`,districtname as district,countryname AS country, statename AS state FROM b2b_leads a LEFT JOIN b2b_commodity c ON a.`comm_id` = c.`comm_id` LEFT JOIN b2b_price_unit e ON a.`lead_unit` = e.unit_id LEFT JOIN b2b_subscribers f ON a.`lead_owner`=f.b2b_subs_id LEFT JOIN `b2b_commodity_category` s ON c.`comm_category` = s.`cate_id` WHERE c.`comm_category`= and a.`comm_id`!=157 AND a.`leads_id`!=4939 AND a.`status` =1 AND c.status=1 and (a.created_date > DATE_SUB(now(), INTERVAL 2 MONTH) OR lead_expiry>=now()) ORDER BY `leads_id` DESC LIMIT 1,3

Filename: models/newb2b/B2b_ui_commodity_leads_model.php

Line Number: 118