Created
June 2, 2018 17:45
-
-
Save gruz/cb2ef9b11a1944ef88e3db13fd150cb6 to your computer and use it in GitHub Desktop.
Joomla output SQL query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Usage | |
echo $db->replacePrefix((string) $query) ; | |
// Example | |
$db = JFactory::getDbo(); | |
$query = $db->getQuery(true); | |
$query->select( 'id' ); | |
$query->from($db->quoteName('#__kunena_categories')); | |
$query->where($db->quoteName('parent_id') . '=' . $db->quote( $parent_id )); | |
$query->where($db->quoteName('name') . '=' . $db->quote( $title )); | |
$db->setQuery($query); | |
echo $db->replacePrefix((string) $query) ; | |
$result = $db->loadResult();; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment