I can't see from the query provided how it could result in that error. Usually it occurs when there is a mismatch resulting from incorrect use of parentheses and usually in conjunction with sub-queries, which obviously does not seem to apply here.
I'm not familiar with the Zend framework, but should there be some method call to execute the query prior to the fetchRow() call?
Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be." ~ from Nation, by Terry Pratchett
The number of unique values in the index. This is updated by running ANALYZE TABLE or myisamchk -a. Cardinality is counted based on statistics stored as integers, so it's not necessarily accurate for small tables. The higher the cardinality, the greater the chance that MySQL uses the index when doing joins.
99 little bugs in the code, 99 bugs in the code,
fix one bug, compile it again...
101 little bugs in the code....
SELECT `g`.*, `u2g`.* FROM `users2groups` AS `u2g` RIGHT JOIN `groups` AS `g` ON `g`.`groupid` = `u2g`.`uggid` WHERE `u2g`.`uguid` = '5bc40bc6-7974-102b-8a2c-d23ebefec1c9'
SQLSTATE: Cardinality violation: 1241 Operand should contain 1 column(s)
From the SyBase PDF linked above:
Cardinality violations occur when a query that should return only a
single row returns more than one row to an Embedded SQL™
That makes sense, but it doesn't apply to my situation, from what I can tell.
Can anyone see what I am doing wrong? The SQL executes in phpMyAdmin (and returns only one row), just not through the Zend framework. It shouldn't matter that it is going through ZF though, since it is returning a valid SQL error ZF is doing it's job.
I found this on page 159, section 5-37 under lock manager messages, code 1241
A semaphore cursor refers to a different semaphore than the one it is linked to.
In English, I think that means:
The column you are accessing refers to a column other than the one you want.
... how would I resolve that?
Last edited by Kudose; 05-22-2008 at 03:46 PM.
Problem Solved? Mark this thread resolved using the Thread Tools. Apache HQ | PHP HQ | MySQL HQ | LinkedIn