OK, I realize that this is more of a Jooma problem than a K2 problem, but it has to do with a K2 extension I've developed.
The problem is, this piece of code doesn't work:
$db = & JFactory::getDBO(); $query = "SELECT * FROM information_schema.TABLES WHERE TABLE_NAME = '#__k2_comments_blacklist'"; $db->setQuery($query); $result = $db->loadresult();
The result of this is, $result is coming out null.
If I take the SELECT statement and paste it into a mysql client (replacing the "#_" with "jos"), it does exactly what it is supposed to do; return a row from information_schema.TABLES which tells me that the table jos_k2_comments_blacklist exists. And I'm accessing mysql with the same mysql user that Joomla uses. I've checked to make sure that $db is defined. And I've tried replacing the "#_" with "jos" in $query. And using loadObjectList() instead of loadresult(). Can anybody tell me what the problem is?