Ask not what osTicket community can do for you - ask what you can do for osTicket community

Go Back   osTicket Forums > osTicket 1.6.x > Mods and Customizations

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-20-2011, 05:07 AM
dwilson dwilson is offline
Junior Member
 
Join Date: Jan 2011
Posts: 5
Exclamation DB error 1064

Can some some clarify this error plz?

[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
Reply With Quote
  #2  
Old 01-20-2011, 09:17 AM
dolmax dolmax is offline
Junior Member
 
Join Date: Feb 2010
Posts: 8
Default

I have the exact same problem and been trying to find out what the cause is.

I'm not sure whether this is related to this mod.
Reply With Quote
  #3  
Old 01-24-2011, 02:45 AM
dolmax dolmax is offline
Junior Member
 
Join Date: Feb 2010
Posts: 8
Default

Anyone?
Reply With Quote
  #4  
Old 01-26-2011, 08:50 AM
mseelenb mseelenb is offline
Junior Member
 
Join Date: Sep 2009
Posts: 3
Default

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).') )';
Try changing:
Code:
$sql.=' WHERE (ticket.dept_id IN ('.implode(',',$depts.') )';
To:
Code:
$sql.=' WHERE (ticket.dept_id IN ('.implode(',',$thisuser->getDepts()).'))';
Hope that helps,
Mark

Last edited by mseelenb; 01-26-2011 at 09:06 AM.
Reply With Quote
  #5  
Old 01-27-2011, 02:52 AM
dolmax dolmax is offline
Junior Member
 
Join Date: Feb 2010
Posts: 8
Default

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
Reply With Quote
Reply

Bookmarks

Tags
1064, database, dberror, error

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:13 AM.