ZF-2112: Zend_Db_Adapter_Interface::fetchCol() does not properly retrieve a column on single column SQL statements.
When using a Mysqli adapter(not sure if this occurs with others) the following produces an error:
Warning: mysqli_stmt::bind_param() [function.mysqli-stmt-bind-param]: Number of variables doesn't match number of parameters in prepared statement in /usr/home/sciworld/application/library/Zend/Db/Statement/Mysqli.php on line 241 This occurs independent of if a column index is provided. Interestingly, the following code does work correctly:
$stmnt = $db->query("SELECT areaID FROM userPermissions WHERE userID='$userID'"); $column = $stmnt->fetchColumn();```
It seems perhaps the parsing of the statement in the first case is not functioning properly, although admittedly I don't have much experience with Zend_Db. I do know the documentation does indicate that the first case should work identically to the second, which is not the case(unless I am missing something here).