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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:11:40+00:00 2026-06-15T20:11:40+00:00

Following on from this thread: Accessing MySQL database – D3 Can anyone help with

  • 0

Following on from this thread: Accessing MySQL database – D3

Can anyone help with a parse error I’m getting? There seems to be conflicting information out there about what can cause this?

Parse error:

Error: Problem parsing d=”M30,NaNL34,NaNL38,NaNL42,NaNL46,NaNL50,NaNL54,NaNL58…….

getdata.php:

    <?php
    $username="*****"; 
    $password="*****";   
    $host="********";
    $link=mysql_connect($host,$username,$password)
    or die("Unable to connect to MySQL");

    mysql_select_db("*****", $link) or die( "Unable to select database"
    .mysql_error());

    $res = mysql_query("SELECT * FROM TestSourceSampleData")
    or die ("Unable to run query");
    $data = array();

    while ($row = mysql_fetch_assoc($res))
    {  
    $data[] = array("reading" => $row['reading']);
    } 
    echo json_encode($data);     
    mysql_close($link);
    ?>

Output from getdata.php:

[{“reading”:”10″},{“reading”:”10.2″},{“reading”:”10.3″},{“reading”:”10.3″}……..

..when print json file:

    Array[120]
    [0 … 99]
    0: Object
    reading: "10"
    __proto__: Object
    1: Object
    reading: "10.2"
    __proto__: Object
    2: Object
    reading: "10.3"
    __proto__: Object
    3: Object
    4: Object
    5: Object

http://bl.ocks.org/5fc4cd5f41a6ddf2df23

  • 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-15T20:11:41+00:00Added an answer on June 15, 2026 at 8:11 pm

    In your block you use:

    var data = jsondata.map(function(d) { return d.Value; });
    

    while in your question you mention that the name of the key is reading, which would mean your code should look like:

    var data = jsondata.map(function(d) { return d.reading; });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Continued from this thread ) Suppose that I have the following view created: http://cl.ly/1USw/content
Another question following on from this thread . The only remaining item that I
In C#, the following code (from this page) can be used to lazily instantiate
Following from this thread: Another IE jQuery AJAX/post problem (please read the thread to
Following from this: Every specific weekday, sql and php I got this: deals_bookings.everyWeekDay =
Following on from this question , I am interested in finding out how you
following on from this question (Developing to an interface with TDD), I'm still having
Following on from this question...I'm trying to unit test the following scenario: I have
Following on from this question... What to do when you’ve really screwed up the
Hi I found the following code from this page JQuery UI DatePicker using 2

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.