|
#1
|
|||
|
|||
|
[SELECT count(open.ticket_id) as open, count(answered.ticket_id) as answered ,count(overdue.ticket_id) as overdue, count(assigned.ticket_id) as assigned FROM ost_ticket ticket LEFT JOIN ost_ticket open ON open.ticket_id=ticket.ticket_id AND open.status='open' AND open.isanswered=0 LEFT JOIN ost_ticket answered ON answered.ticket_id=ticket.ticket_id AND answered.status='open' AND answered.isanswered=1 LEFT JOIN ost_ticket overdue ON overdue.ticket_id=ticket.ticket_id AND overdue.status='open' AND overdue.isoverdue=1 LEFT JOIN ost_ticket assigned ON assigned.ticket_id=ticket.ticket_id AND assigned.staff_id=8 WHERE (ticket.dept_id IN () )] 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 ') )' at line 1
|
|
#3
|
|||
|
|||
|
Anyone?
|
|
#4
|
|||
|
|||
|
For some reason, I'm not able to see all of Masino's code (just what he posted in these forums), but I'm assuming you've made the following change to tickets.php:
Code:
} elseif ($thisuser->isManager()) { // manager can access tickets belong to his/her dept.
$sql.=' WHERE (ticket.dept_id IN ('.implode(',',$depts).') )';
Code:
$sql.=' WHERE (ticket.dept_id IN ('.implode(',',$depts.') )';
Code:
$sql.=' WHERE (ticket.dept_id IN ('.implode(',',$thisuser->getDepts()).'))';
Mark Last edited by mseelenb; 01-26-2011 at 09:06 AM. |
|
#5
|
|||
|
|||
|
Dear Mark,
I have edited related parts in Masino's code, based on your input. This solved the problem. I no longer get DB errors. Thanks for your contribution. I'll make sure I add corrected code in the other MOD article. Will also make sure you get the credit. Hakan |
![]() |
| Bookmarks |
| Tags |
| 1064, database, dberror, error |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|