Мои заказы

PDOException Object ( [message:protected] => SQLSTATE[42000]: Syntax error or access violation: 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 orders.status = orders_status.id' at line 1 [string:Exception:private] => [code:protected] => 42000 [file:protected] => /web/blok-optom.ru/protected/src/functions.php [line:protected] => 72 [trace:Exception:private] => Array ( [0] => Array ( [file] => /web/blok-optom.ru/protected/src/functions.php [line] => 72 [function] => query [class] => PDO [type] => -> [args] => Array ( [0] => SELECT orders.id as idOrd, orders.status, orders.user_id, orders.date, orders.delivery_date, orders.pay_variant, orders_status.* FROM orders, orders_status WHERE orders.user_id = AND orders.status = orders_status.id ) ) [1] => Array ( [file] => /web/blok-optom.ru/protected/general/кабинет/заказы.act [line] => 9 [function] => db_select [args] => Array ( [0] => orders, orders_status [1] => orders.id as idOrd, orders.status, orders.user_id, orders.date, orders.delivery_date, orders.pay_variant, orders_status.* [2] => orders.user_id = AND orders.status = orders_status.id ) ) [2] => Array ( [file] => /web/blok-optom.ru/protected/src/functions.php [line] => 210 [args] => Array ( [0] => /web/blok-optom.ru/protected/general/кабинет/заказы.act ) [function] => include ) [3] => Array ( [file] => /web/blok-optom.ru/protected/src/functions.php [line] => 221 [function] => get_lay [args] => Array ( [0] => кабинет/заказы.act ) ) [4] => Array ( [file] => /web/blok-optom.ru/index.php [line] => 56 [function] => get_lay [args] => Array ( [0] => кабинет.act ) ) ) [previous:Exception:private] => [errorInfo] => Array ( [0] => 42000 [1] => 1064 [2] => 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 orders.status = orders_status.id' at line 1 ) )