references:joomla.framework:database:jdatabase-queryquery
Executes the current SQL query string. This method returns a database resource if successful, false otherwise. The syntax and semantics of SQL statements are beyond the scope of this manual. Prior to Joomla! 1.5 the only database software supported was MySQL and the reference manual may be found at http://dev.mysql.com/doc/. Syntaxmixed query() ExamplesExample $database =& JFactory::getDBO(); $sql = "SELECT * FROM #__categories"; $database->setQuery( $sql ); if (!$result = $database->query()) { echo $database->stderr(); } echo $database->getNumRows( $result ); might produce: Result 23
Discussion |


