Copy the image location inside of that IMG tag and load it in a new
browser tab. What's the error that Google is giving you?




--
Jon Ursenbach
Web Engineer, Decorati Inc.
116 New Montgomery St. Ste 530
San Francisco, CA 94105
[email protected]
415-227-4558
www.decorati.com



On Wed, Jun 3, 2009 at 11:52 AM, lmg <[email protected]> wrote:
>
> I am trying to create a pie chart based on information I am getting
> from a database. Yesterday when I was trying to get it to work, things
> were going well; however, today I am having no luck. I am following
> the same procedure as yesterday, but the graph is not showing up.
>
> Here is my code:
>
> <?php
>
> //set the username, password, and database name
> $username="user";
> $password="pass";
> $database="data";
>
> //connect and select the database
> @mysql_connect(localhost,$username,$password) or die("Cannot connect
> to database");
> @mysql_select_db($database) or die( "Unable to select database");
>
> //Gets all of the information from each of the sections and adds them
> up. Generates pie from the results
>
> //get all information values
> $query = "SELECT * FROM answer WHERE answerID=2";
> $result=mysql_query($query);
> $array=mysql_fetch_array($result);
> mysql_close();
>
>
> $n=0;
> $m=0;
> $p=0;
> $s=0;
> $f=0;
>
> //Go through the answers and see how many were each type.
> //n=nc, m=mc, etc.
> for($i=1; $i <= 79; $i++){
>        switch($array[$i]){
>                case 1:
>                        $n++;
>                        break;
>                case 2:
>                        $m++;
>                        break;
>                case 3:
>                        $p++;
>                        break;
>                case 4:
>                        $s++;
>                        break;
>                case 5:
>                        $f++;
>                        break;
>        }
> }
>
> echo "n:".$n."m: ".$m."p: ".$p."s: ".$s."f: ".$f;
>
> $title="Results";
> include("header.php");
>
> ?>
>
> <html>
> <body>
> <form>
>
> <a href="session.php"><font face="Arial">Return to Main Menu</font></
> a>
> <br>
> <br>
>
> <!--From Google chart apis (http://code.google.com/apis/chart/
> basics.html):
>                http://chart.apis... - Chart API's location
>                &amp; - separate paramaters
>                chs - chart's size in pixels
>                chd - chart's data
>                cht - chart type
>                chl - chart labels (separated with |). If you want a legend 
> instead,
> use the command chdl (same format otherwise)-->
>
> <center><img src="http://chart.apis.google.com/chart?chs=750x300
>                &amp;chd=t:<?php $n; ?>,<?php $m; ?>,<?php $p; ?>,<?php $s; 
> ?>,<?php
> $f; ?>
>                &amp;cht=p
>                &amp;chl=NC|MC|PC|SC|FC"/></center>
>
> <br>
>
> </form>
> </div>
> </body>
> </html>
>
> <?php
>
>        include("footer.html");
>
> ?>
>
> The echo statements are showing the correct values.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-chart-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to