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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:29:53+00:00 2026-05-31T18:29:53+00:00

$.getJSON(./data/revenue-item-data.php,{val:’val’},function(data){ $(‘#totalUnits’).val(data[0].SUM(item_qty)); $(‘#totalAmounts’).val(data[0].SUM(DISTINCT net_total)); }); Here is array I get for above code: [{SUM(item_qty):68,SUM(DISTINCT

  • 0
$.getJSON("./data/revenue-item-data.php",{val:'val'},function(data){

 $('#totalUnits').val(data[0].SUM(item_qty));
     $('#totalAmounts').val(data[0].SUM(DISTINCT net_total));


 });

Here is array I get for above code:

 [{"SUM(item_qty)":"68","SUM(DISTINCT net_total)":"42753"}]

How to display these 2 values (68 , 42753) in #totalUnits & #totalAmounts.This code does not display any thing.

  • 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-05-31T18:29:55+00:00Added an answer on May 31, 2026 at 6:29 pm

    You can not call data[0].SUM(item_qty) as it treats SUM as a method. Try this.

    data[0]['SUM(DISTINCT net_total)']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$.getJSON('ajax_popup.php', function(data) { var popupDiv = decodeURIComponent(data.data); $('body').append( popupDiv ); }); This piece of
The code: function updateDashboardData() { $.getJSON(includes/system/ajaxDataInterface.php, {recordcount:1}, function(data) { $('.stationContainer').each(function(data) { var bsID =
var list = []; $.getJSON(json.js, function(data) { $.each(data, function(i, item) { console.log(item.text); list.push(item.text); });
Why does this code always return 0? var possibleMatches = new Array(); $.getJSON('getInformation.php', function(data)
$.getJSON('http://twitter.com/followers/ids.json?screen_name=' + query1 + '&callback=?', function (data) { console.log('JSON data string 1 is: '
I am attempting to pase a a JSON data using the JQuery getJSON function.
I have this code: $.getJSON(Featured/getEvents, function(data){ $.each(data.events, function(i,event){ var title = event.title.substr(0,20); $(#title-+i).text(Text); if
$(function(){ $.getJSON('http://ws.audioscrobbler.com/2.0/?method=user.getweeklyartistchart&user=ElicitBelief&api_key=25135a535781328243f9e31968abc14&format=json', function(data) { alert(data) }); }); Firebug says: GET http://ws.audioscrobbler.com/2.0/?method=user.getweeklyartistchart&user=ElicitBelief&api_key=25135a535781328243f9e31968abc14&format=json 200 OK 144ms
$.getJSON(/data/data/com.android.tcptest/files/BPL.json, function(data) { var i = 0, dataSize = data.length, tmpArray = []; for(i;
I am using $.getJSON() to pass some data to the server side (PHP, Codeigniter)

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.