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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:40:48+00:00 2026-05-19T14:40:48+00:00

I have a PHP script that selects some data from mysql and throw it

  • 0

I have a PHP script that selects some data from mysql and throw it into the following line:

$json_arr[] = array ('date'=>$human_date,'weight'=>$data['weight']);

As I run of a server with PHP4 I am using the Services_JSON (http://pear.php.net/pepr/pepr-proposal-show.php?id=198) script to JSON-ify the data:

$json = new Services_JSON();
echo $json->encode($json_arr);

In the JS file I want to show all the weights & dates:

$.getJSON('ajax/getweights.php', {userid: userid}, function(data) { 

  $.each(data, function(k, v) {
    alert(v + ': ' v);
  });
});

How ever when I run the script, I dont get the wanted result, eg 2011-01-10:90,2011-01-15:92, 2011-01-18:89.

Im rather new to jQuery, and I have been searching the net for answers and I have tried to figure out how to read those data – I hope someone can help me 🙂

  • 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-19T14:40:49+00:00Added an answer on May 19, 2026 at 2:40 pm

    Assuming the server sends the data in the following format:

    [ { date: '2011-01-10:90', weight: '1' }, 
      { date: '2011-01-15:92', weight: '2' }, 
      ...
    ]
    

    you could:

    $.each(data, function(k, v) {
        alert('date: ' + v.date + ' | weight: ' + v.weight);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP server script that SELECTs some data from a MySQL database.
Specifically I have a PHP command-line script that at a certain point requires input
I made some CMS in PHP which manipulates with data from MySQL. In my
For some reason, JavaScript/PHP wont delete my data from MySQL! Here is the rundown
I'm currently working on a PHP/MySQL script that does the following, in this order:
I have a html page that calls a php object to get some data
I have a PHP script that runs as a CGI program and the HTTP
I have a PHP script that needs to determine if it's been executed via
I have a PHP script that initialises an image gallery. It loops through all
I have a PHP script that can encode a PNG image to a Base64

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.