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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:47:24+00:00 2026-05-22T19:47:24+00:00

Been looking around the web, but not found anything so far… can anyone help?

  • 0

Been looking around the web, but not found anything so far… can anyone help?

I have created a simple html page that contains a list-box of values that when selected calls a seperate php script to run database query and print out a structure html page. This has been implemented using ajax calls and it results in the page being reloaded when the user changes the value in the list-box.

Now, I would like to move away from the generating of the table using html tags and print statemetns to something more slick and have discovered google visualisation api. I have look ready through many pages of the site and used the code playground, but was unable to find information to help me understand how I might use the visualization api to generate the table and pass this back to the main page in the div tag, using the same php script.

Does anyone have any pointers, or experience of doing this in the past?

Thanks.

  • 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-22T19:47:24+00:00Added an answer on May 22, 2026 at 7:47 pm

    You could achieve this using jQuery AJAX and some arrays generated by your php. This is a pretty basic but straightforward approach – you may want to look around for php client libraries that generate gviz code for you in your php if this proves to be insufficient.

    Here’s a working example:

    HTML file

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <script type="text/javascript" src="http://www.google.com/jsapi"></script>
        <script type="text/javascript">
          google.load("jquery", "1.6.1");
          google.load('visualization', '1', {packages: ['table']});
        </script>
        <script type="text/javascript">
    
        function drawVisualization(dataFromAjax) {
          var data = google.visualization.arrayToDataTable(dataFromAjax);
          visualization = new google.visualization.Table(document.getElementById('table'));
          visualization.draw(data);
        }
    
        function makeAjaxCall() {
          $.ajax({url:'test.php',
                  data: {},
                  success: function(responseData) {
                             // eval just for testing - make safer
                             var arrayForGviz = eval("(" + responseData + ")");
                             drawVisualization(arrayForGviz);
                           }
            });
        }
        </script>
      </head>
      <body>
        <input type="button" onclick="makeAjaxCall();return false;" value="Click to get data"></input>
        <div id="table"></div>
      </body>
    </html>
    ​
    

    ​PHP File

    <?php
    echo "[['Country','City','Value'],
           ['Ireland','Dublin','10'],
           ['France','Paris','15']]"
    ?>
    

    Obviously my php file is static, but each time the user interacts with the page and triggers makeAjaxCall() you could send different parameters, and return different array responses.

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

Sidebar

Related Questions

I have been looking around on the web and found some articles about the
I've been looking around the web but I've yet to found any information on
I've been looking around the System.Xml namespace, but don't see anything that would support
I've been looking around but I can't seem to find any implementation of POSIX
I have been looking around stackoverflow for automated GUI tools for testing our web
I know this question has been asked a bit before. But looking around I
I need an import tools for a web app. I've been looking around and
I've been looking around for a while how can I hotdeploy my projects when
I have been looking around for examples related to converting JSON strings to Java
i have been looking around to find some nice working example of implementing Membership

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.