Development

Simple update statement in Joomla

Simple update statement in Joomla

A simple UPDATE statement in Joomla PHP code with the database object. It uses old Joomla 3 syntax; on Joomla 4 and newer, use the query builder.

Below you can find a simple update statement for PHP in Joomla!

$db =& JFactory::getDBO();
$query = "UPDATE #__courseinfo SET courseQuota =". $quota." WHERE id=".$row- >courseCode ;
echo"$query";
$db->setQuery( $query );
$db->query();

Stuck on something else?

Doctor Joomla is a project of Cloudfaction, a Dutch agency building and maintaining Joomla sites since 1999. The articles are made with the help of AI, so tell us if something does not match your screen. Mail info@cloudfaction.nl if you want someone to look at yours.

Rather have someone look at it

Doctor Joomla is a Cloudfaction project.

A Dutch agency that has been building and running Joomla sites since 1999. If your site needs more than an article can fix, get in touch.