Actions

CodeExample

Difference between revisions of "Debugging a specific query"

From Joomla! Documentation

(Creation)
 
(External links removed. See JDOC:Wiki_policy. Also fixed minor formatting issues.)
Line 3: Line 3:
 
//$db = your db object gotten before, with a query loaded (set)
 
//$db = your db object gotten before, with a query loaded (set)
 
var_dump($db->replacePrefix( (string) $db->getQuery()) );//debug
 
var_dump($db->replacePrefix( (string) $db->getQuery()) );//debug
</source><small>You can also try this with some [[How_to_debug_your_code|other debug methods]] in stead because a "var_dump" (bit like echo) will not always display on your screen.<br/>[http://e-motiv.net e-motiv development] 09:39, 11 September 2012 (CDT)</small>
+
</source>You can also try this with some [[How_to_debug_your_code|other debug methods]] instead because a "var_dump" (bit like echo) will not always display on your screen.
 
[[Category:JDatabase::debug]][[Category:JDatabase]][[Category:Database]][[Category:CodeExample]] [[Category:MethodExample]]
 
[[Category:JDatabase::debug]][[Category:JDatabase]][[Category:Database]][[Category:CodeExample]] [[Category:MethodExample]]

Revision as of 09:58, 11 September 2012

Example:debugging a specific query

//$db = your db object gotten before, with a query loaded (set)
var_dump($db->replacePrefix( (string) $db->getQuery()) );//debug

You can also try this with some other debug methods instead because a "var_dump" (bit like echo) will not always display on your screen.