zeboidlund
zeboidlund

Reputation: 10137

Joomla and MySQL

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

What I'm really looking for:

Upvotes: 3

Views: 2271

Answers (2)

Antonio Laguna
Antonio Laguna

Reputation: 9282

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

Upvotes: 7

Damien Pirsy
Damien Pirsy

Reputation: 25435

Yes, it has its own class, it's the class JDatabase if I recall correctly. There's an API page where you get all the documented code on the framework.

A this Joomla WIKI, then, you have example on how to use the database class. Don't know if updated to the latest (1.7) version, but I'm pretty sure it works the same (at least did for the 1.6)

Upvotes: 3

Related Questions