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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:40:03+00:00 2026-05-17T17:40:03+00:00

I am trying to access a jQuery JSON object, and I can’t see anything

  • 0

I am trying to access a jQuery JSON object, and I can’t see anything wrong witj my code, but all I get when I try to access the object is undefined, I was thinking that maybe it’s because of the way it is nested, but I am unsure, here is my code,

 function systems(dom_id, id){
  $.getJSON("get_systems.php", {uid:id}, function(data){
  // here I get the general system info related to the user 
     $.each(data, function(i, json){
    //here I get each systems name, related to each system
    $.getJSON('get_system_name.php', {uid:json.product_id}, function(data){
     console.log(data.products);
     $(dom_id).append('<tr><th>'+data.products+'</th></tr>');
    });

   });

  });
 };

The column name with the name of the system in it, is named products, hence me trying to get the name using data.products, but all I get is undefined as I mentioned above.

But when I just log data it shows the object, which looks like this, [Object { products="this is the product name"}] and this is the PHP that I use to get the system names,

get_system_name.php:

<?php
$uid = $_GET['uid'];

mysql_connect("localhost", "user", "1234") or die(mysql_error());
mysql_select_db("the_DB") or die(mysql_error());
$query = mysql_query("SELECT products FROM products WHERE product_id='$uid'") or die(mysql_error());

while($array = mysql_fetch_array($query, true)) {
 $string[] = $array;
}

$json = json_encode($string);
echo $json;
?>

Thanx in advance!

  • 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-17T17:40:04+00:00Added an answer on May 17, 2026 at 5:40 pm

    By the looks of this line:
    [Object { products="this is the product name"}]

    data is actually an array of JSON, not a JSON. So if you did

    data[0].products

    , it should work. You might want to look into why it’s coming back as an array though, unless that’s your desired behaviour.

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

Sidebar

Related Questions

I'm trying to use jQuery to access a DOM object that appears earlier in
I'm trying to access YQL with jQuery but am not getting a response: http://jsfiddle.net/tastyapple/grMb3/
Ok, i'm fairly new to jQuery JSON stuff. I'm trying to access the actions
I'm trying to access JSON data with jQuery and grab a specific set of
I'm trying to post the lang_id var. to get_lang.php with jquery to get (json)
I'm trying to access the Facebook API Admin.getMetrics method via jQuery. I'm correctly composing
I'm trying to use JQuery's $.getJSON to access Model data from the Controller, and
I'm trying to take an existing JSON object and create smaller JSON chunks out
I'm trying to pass a JavaScript object to a PHP script through jquery.ajax() ,
I'm having a problem trying to return a specific record using jQuery and JSON.

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.