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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:01:29+00:00 2026-06-12T11:01:29+00:00

I am having a problem retrieving data out of an object passed back from

  • 0

I am having a problem retrieving data out of an object passed back from PHP. I’ve tried many different ways to access this data and none work.

In Firebug I see the following… (it looks nicer in Firebug) – I tried to make this look as close to Firebug as possible

results Object { data=”{“formName”:”form3″,”formData”:”data goes here”}”, phpLiveDebug=”<…s: 198.91.215.227″}

data “{“formName”:”form3″,”formData”:”data goes here”}”

phpLiveDebug “<…s: 198.91.215.227”

I can access phpLiveDebug no problem, but the data portion is an object. I have tried the following…

        success: function(results) {
            //$("#formName").val(results.data.formName);
            //$("#formName").val(results.data[0].formName);
            //$("#formName").val(results.data[0]);
            //$("#formName").val(results.data[1]);
            //$("#formName").val(results.data[0]["formName"]);
            var tmp = results.data[formName]; 
            alert("!" + tmp + "!");
            $("#formName").val(tmp);
            $("#jqueryPHPDebug").val(results.phpLiveDebug);
        }

This line works in the example above…

$("#jqueryPHPDebug").val(results.phpLiveDebug);

but… I can’t figure out how to get at the data inside the results.data portion… as you can see above, I have been trying different things and more not even listed there.

I was really hoping this line would work 🙂

var tmp = results.data[formName];

But it doesn’t. So, after many days of reading, tinkering, my solution was to re-write it to return data similar to the phpLiveDebug but then I thought… it’s gotta be something simple I’m overlooking…

Thank you for your time. Please try and explain why my logic (my horrible attempts at trying to figure out the proper method) above is wrong if you can?

UPDATE – this line here SHOULD have worked… but didn’t… here is why…

        success: function(results) {
            //$("#formName").val(results.data.formName);

Why that didn’t work…

In my function I had…

    $jsonData["formName"] = $rowName; // the name of the form we are fetching
    $jsonData["formData"] = "data goes here";

    return (json_encode($jsonData));

How I called the function…

$dataReturn["data"] = $ds1->Invoke(rawurldecode($_POST["data"]));
if (DEBUGMODE) $dataReturn["phpLiveDebug"] = EH::CloseDebug();
exit (json_encode($dataReturn));

I was DOUBLE ENCODING the data… and for some reason…

$("#formName").val(results.data.formName);

Was not working.

I fixed the code by changing 1 line…

return (json_encode($jsonData));

to

return $jsonData;

Hope this helps someone!

I don’t know exactly what it did to not work but… it works now!

I wonder what happens internally when you encode an array and then add another array and RE encode that! Double encoding. My bad.

  • 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-12T11:01:30+00:00Added an answer on June 12, 2026 at 11:01 am

    The keys are strings.

    var tmp = results.data['formName'];
    

    or

    var tmp = results.data.formName;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason I'm having a problem retrieving data from my database. It leaves
I am having a problem while retrieving data from an ArrayList and displaying them
I'm having a problem with retrieving information from a MySQL Table with PHP. I
For some reason I'm having a problem retrieving data from my database. It leaves
I am having trouble retrieving some data out of an LDAP attribute in PHP.
i am having a problem while retrieving the data coming from Json... i am
I am having problem with $_GET array. More precisely I'm retrieving data from mysql
I am having a problem retrieveing information from a MySQL Data Base. Could you
I am having a problem with deleting cookies in classic ASP. Setting and retrieving
I'm having problems with retrieving multiple instances of a session variable from an InProc

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.