phpCollab Community
Discuss everything phpCollab!

The forums are currently in READ-ONLY mode while we upgrade the forums.
Home » Support » General Support » Unknown column 'Array' in 'where clause'
Unknown column 'Array' in 'where clause' [message #7578] Thu, 16 February 2006 16:48 Go to next message
mjbaysek is currently offline  mjbaysek
Messages: 3
Registered: February 2006
phpCollab guest
I am getting an SQL error when I try to reorder the columns after generating a report.

The Error is
Unknown column 'Array' in 'where clause'

The SQL statement being executed is:

43 Connect root@localhost on
43 Init DB phpcollab
43 Query SELECT tas.*, mem.id, mem.name, mem.login, mem.email_work, mem2.id, mem2.name, mem2.login, mem2.email_work, mem.organization, pro.name, org.id
FROM tasks tas
LEFT OUTER JOIN members mem ON mem.id = tas.assigned_to
LEFT OUTER JOIN projects pro ON pro.id = tas.project
LEFT OUTER JOIN members mem2 ON mem2.id = tas.owner
LEFT OUTER JOIN organizations org ON org.id = pro.organization
WHERE ( tas.project IN(Array) AND org.id IN(Array) AND tas.assigned_to IN(Array) AND tas.status IN(Array) AND tas.priority IN(Array)) ORDER BY tas.priority ASC
43 Quit

I found a post http://www.php-collab.org/community/index.php?t=msg&goto =5356&S=4f1202537df568e99c8c58b0e052e702&srch=report +sort#msg_5356 that described a sorting problem, but it is different, and not this version. This was the only problem I found on the forums with report sort problems.

I am running 2.5rc3.

Anyone else seeing this?

Re: Unknown column 'Array' in 'where clause' [message #7733 is a reply to message #7578] Mon, 24 July 2006 19:07 Go to previous messageGo to next message
razordu30 is currently offline  razordu30
Messages: 2
Registered: July 2006
phpCollab guest
Can someone please address this? Basically, while looking at a report, you can't sort anything or it results in a

Unknown column 'Array' in 'where clause'

error. If anyone could respond, that would be great.
Re: Unknown column 'Array' in 'where clause' [message #7737 is a reply to message #7578] Thu, 27 July 2006 23:59 Go to previous messageGo to next message
rcave is currently offline  rcave
Messages: 13
Registered: June 2006
phpCollab guest
The problem is because the sort variables are turning into arrays. I haven't dug through the code enough to figure out what the correct fix should be, but the following will get you through the error. Once I determine the appropriate fix, I'll add it to the modifications message board.

Note: Note that the sort generally works, but some tasks/subtasks are not sorted correctly.

============================
reports/resultsreport.php
============================

Find
if ($S_PRJSEL != "ALL" || $S_ORGSEL != "ALL" || $S_ATSEL != "ALL" || $S_STATSEL != "ALL" || $S_PRIOSEL != "ALL" || $S_DUEDATE != "ALL" || $S_COMPLETEDATE != "ALL")


Above that, add code to check if the variables are arrays and take only the first variable if it is an array:

if (is_array($S_PRJSEL)) {
    $S_PRJSEL=$S_PRJSEL[0];
}
if (is_array($S_ORGSEL)) {
    $S_ORGSEL=$S_ORGSEL[0];
}
if (is_array($S_ATSEL)) {
    $S_ATSEL=$S_ATSEL[0];
}
if (is_array($S_STATSEL)) {
    $S_STATSEL=$S_STATSEL[0];
}
if (is_array($S_PRIOSEL)) {
    $S_PRIOSEL=$S_PRIOSEL[0];
}
Re: Unknown column 'Array' in 'where clause' [message #7738 is a reply to message #7578] Fri, 28 July 2006 09:45 Go to previous messageGo to next message
fullo is currently offline  fullo
Messages: 390
Registered: January 2003
Location: faenza (ra)
phpCollab contributor
phpCollab Project Leader

thanks, added to cvs Smile
Re: Unknown column 'Array' in 'where clause' [message #7739 is a reply to message #7578] Fri, 28 July 2006 14:06 Go to previous messageGo to next message
razordu30 is currently offline  razordu30
Messages: 2
Registered: July 2006
phpCollab guest
Still doesn't work for me; same error occurs. =/
Re: Unknown column 'Array' in 'where clause' [message #7960 is a reply to message #7733] Wed, 07 March 2007 02:39 Go to previous message
lbberk is currently offline  lbberk
Messages: 1
Registered: March 2007
phpCollab guest
After upgrade from RC1 to RC3, I also have the same problem. I entered the suggested code and still got the error.

I did a new install, which required a new database. The database was not compatible with the old one for a straight copy due to a change in the number of columns in some of the tables, but I finally transferred the data from most of the fields.

I can now see reports and Gantt charts, which I couldn't do in the RC1 version.

[Updated on: Wed, 07 March 2007 04:27]

Report message to a moderator

Previous Topic: Couple of Questions
Next Topic: Custominzing Email Question
Goto Forum:
  


Current Time: Thu Jun 20 02:07:10 CEST 2013

Total time taken to generate the page: 0.27876 seconds