====== explain ====== {#JAPI Joomla.Framework Database JDatabase::explain #} This is a diagnostic function that performs an SQL EXPLAIN on the current SQL query string. The result is returned in an HTML table. ===== Syntax ===== void explain () ===== Examples ===== $database = JFactory::getDBO(); $query = "SELECT id" . "\n FROM #__menu" . "\n WHERE menutype='mainmenu'" . "\n AND published='1'" . "\n ORDER BY parent, ordering"; $database->setQuery( $query ); echo $database->explain (); might produce:
EXPLAIN SELECT id
 FROM jos_menu
 WHERE menutype='mainmenu'
 AND published='1'
 ORDER BY parent, ordering
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE jos_menu ref menutype menutype 228 const 9 Using where; Using filesort

 
---- ~~DISCUSSION~~