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 8498109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:18:47+00:00 2026-06-11T00:18:47+00:00

I want that when someone votes for article information, it gets inserted into two

  • 0

I want that when someone votes for article information, it gets inserted into two tables
(or run any two queries, does not matter, insert, update or select).
I am using Joomla! 2.5.0 Stable.

components/com_content/models/article.php
public function storeVote($pk = 0, $rate = 0)

when executing this query:

$db->setQuery(
'INSERT INTO #__content_rating ( content_id, lastip, rating_sum, rating_count )' .
' VALUES ( '.(int) $pk.', '.$db->Quote($userIP).', '.(int) $rate.', 1 )'

I want that the information in #__content table will be inserted too.
How do I achieve that?
I tried following, but it does not work:

$db->setQuery(
'INSERT INTO #__content_rating ( content_id, lastip, rating_sum, rating_count )' .
' VALUES ( '.(int) $pk.', '.$db->Quote($userIP).', '.(int) $rate.', 1 )'

// 'UPDATE #__content ' .
' SET testas2 = rating_sum + '.(int) $rate .
' WHERE content_id = '.(int) $pk

// 'INSERT INTO #__content ( testas2 )' .
' VALUES (7799)'
);

This is picture with the syntax:
http://i49.tinypic.com/1ruux0.jpg

I read about MySQL transaction, will it help me in this case? If yes, then what should the syntax should look like?
Any advice is much appreciated.

  • 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-11T00:18:48+00:00Added an answer on June 11, 2026 at 12:18 am

    Try to run the following directly in the DB (use phpAdmin):

    UPDATE edqfi_content_rating , edqfi_content 
    SET edqfi_content_rating.rating_count = edqfi_content_rating.rating_count + 1, 
    edqfi_content_rating.rating_sum = edqfi_content_rating.rating_sum + 3, 
    edqfi_content_rating.lastip = '88.119.189.154',
    edqfi_content.testas2=edqfi_content_rating.rating_sum + 3 
    WHERE edqfi_content_rating.content_id = 13
    AND edqfi_content.id= 13
    

    and see if you get any errors.

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

Sidebar

Related Questions

I want that everytime someone wants to checkout the project from SVN he/she will
I want that screenCheck function show run only after Validation of #contact_email . But
I have got an edit text where I want that when someone insert her
I have one image. i want that when someone scrolls the browser window then
I have a web API that I want to allow any domain to submit
I have set a default value in textarea. I want that when someone clicks
I created a web service (REST) in C#. Now I want that when someone
I have a html file that has two buttons, approve and reject. I want
I have two tables, one which stores articles and the number of votes it
I want that whenever the user types http://localhost:8280/services/Facebook/sea the actual request should be http://localhost:8280/services/Facebook/search?q=jack

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.