Can you tell me if Joomla SQL drivers support prepared statements? As far as I understand, the MySQLi driver does not prepare SQL statements. But Joomla also supports MySQL PDO driver. Does this driver prepare SQL statements? Is it safe to use Joomla SQL wrappers?


Prepared Statements are possible in Joomla 4

$db    = JFactory::getDbo();
$query = $db->getQuery(true);

$value = 'string';

      ->where($db->quoteName('foo') . ' = :myfield')
      ->bind(':myfield', $value);


$records = $db->loadObjectList();

Some references:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.