Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9319825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:28:49+00:00 2026-06-19T03:28:49+00:00

How do to use jdatabase to update a record in Joomla3. Here is what

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-19T03:28:50+00:00Added an answer on June 19, 2026 at 3:28 am

    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.

    $query->set('h.name = 'apple', h.description= 'orange', h.url = 'bannana'');
    

    should be (note the quotes):

    $query->set('h.name = "apple", h.description= "orange", h.url = "bannana"');
    

    Also:

    $db =& JFactory::getDBO();
    

    will throw a “Strict Standards” warning in developer mode. Just remove the ampersand.

    The missing piece:

    try {
        $result = $db->execute();
    } catch (Exception $e) {
        die($e->getMessage());
    }
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the query to retrieve selected record in textbox ./.. How to use
I have the following code in a Spring JdbcTemplate based dao - getJdbcTemplate().update(Record Insert
Let's say I have a REST method to update a record. That would obviously
This is kinda a noob question. I have a controller that update record from
i want to update all records in my database(mongodb),I tried to use command below
I periodically receive data that I use to update my database with. The external
I use this code to update data in database table. Can reuse same code
I have to use oracle database in android. I have tried to work as
I want to use Access database with query for pivot table in Excel. How
Im trying to update a record in my table however im receiving the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.