Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Joomla and MySQL

Tags:

php

mysql

joomla

Is there specific documentation available on Joomla regarding making database queries via MySQL in PHP?

What I'm really looking for:

  • Whether or not Joomla has it's own database wrapper implemented, and if not, is it recommended to create one using the specified config parameters.
  • Whether or not Joomla has the capability to parameterize their queries to prevent SQL injection.
like image 891
zeboidlund Avatar asked Feb 02 '26 15:02

zeboidlund


1 Answers

Yes, Joomla has it's own OOP defined to deal with databases.

Usually, you will deal with code like this:

$db =& JFactory::getDBO();

$query = "SELECT * FROM #__example_table WHERE id = 999999;";
$db->setQuery($query);

Can read more here: How to use the database classes in your script

like image 90
Antonio Laguna Avatar answered Feb 05 '26 05:02

Antonio Laguna