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

  • Home
  • SEARCH
  • 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 8634595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:45:48+00:00 2026-06-12T09:45:48+00:00

I want to run many SQL update queries at one time using JOOMLA 2.5.

  • 0

I want to run many SQL update queries at one time using JOOMLA 2.5. Below my code:

require_once '../includes/framework.php';  
$query = "UPDATE #__mytable SET myfield='value' where id=1; UPDATE #__mytable SET  
myfield='value' where id=2; UPDATE #__mytable SET myfield='value' where id=3;";  
$db = JFactory::getDbo();  
$db->setQuery($query);  
$db->query();

But it shows me a syntax error. I tried to test directly in MYSQL and it works.

  • 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-12T09:45:49+00:00Added an answer on June 12, 2026 at 9:45 am

    PHP does not allow multiple queries by default. You can force it to do so by adding a parameter to mysql_connect, but I wouldn’t recommend it (it opens huge security holes for SQL injections).

    I don’t know how JFactory handles this, but I would be surprised if it were different.

    More infos about it: http://de3.php.net/manual/en/function.mysql-query.php#91669

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

Sidebar

Related Questions

I want to run code which needs boost libraries. I built it using CMake.
I have a project that utilizes Entity Framework. I want to run SQL Server
Why this code don't work,when i want run this code vwd 2008 express show
I want to run an update query. The query will be run against multiple
I want to run wget as follows shell_exec('wget 'http://somedomain.com/somefile.mp4''); sleep(20); continue my code... What
I want to run some code before an object is removed from a has_many
I am using Linq To Sql as my database layer for the first time
i am installing SQL server 2008 express and found that many exe run on
I'm using SQLCommand in C# to run SQL against a local machine which will
I have a query, of very many lines, that I want to run in

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.