How do to use jdatabase to update a record in Joomla3. Here is what i have so far.
$db =& JFactory::getDBO();
$query = $db->getQuery(true);
$query->update('#__test AS h');
$query->set('h.name = 'apple', h.description= 'orange', h.url = 'bannana'');
$query->where('h.id=1');
$db->setQuery($query);
Am i missing something simple?
I just spent the day banging my head against the wall with this too. You’re very close, but you just need some minor tweaks.
should be (note the quotes):
Also:
will throw a “Strict Standards” warning in developer mode. Just remove the ampersand.
The missing piece:
P.S. I realize this answer is a bit late so I hope that you’ve solved your problem by now. I am posting this answer for those who come across it later and can’t find the solution in Joomla’s shitty documentation.