[PHP-DB] jpgraph and mysql passing array

2011-03-23 Thread Chris Stinemetz
Hello,



I hope you can help me. The Jpgraph forum seems to be pretty
uneventful with participation.

I am trying to pass arrays through the image tag to populate my
variables for my graph.

I keep getting an error that there is no input. Do you have any suggestions?

I would greatly appreciate it! I have been trying to figure this out
for several hours.



Below is my code:



I need some help with finding a solution. For some reason my graph is
not showing up when it evident that my arrays are being passed.



When I use:



echo TEST DATA PRINT;

print_r($datay,false);



---



I keep getting the error:

Empty input data array specified for plot.



---



My php script is as follows:

---



!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html xmlns=http://www.w3.org/1999/xhtml;



head

titleKCRF Dashboard/title

?php

ini_set('display_errors', 1);

error_reporting(E_ALL);



$term=$_POST['term'];

$term2=$_POST['term2'];

$term3=$_POST['term3'];



//include ('err_reporting.php');

require ('PHP_Scripts/config.php');

require_once ('jpgraph/jpgraph.php');

require_once ('jpgraph/jpgraph_line.php');



   $sql = (SELECT * FROM evdobanding WHERE Market like '%$term' and
Cell_Sect = '$term2' and Date = '$term3' ORDER BY distance asc);

   $result = mysql_query($sql);



   while($row = mysql_fetch_array($result))

   {

   $datay[] = $row[MBusage];

   $datax[] = $row[Distance];

   }

  echo TEST DATA PRINT;

  print_r($datay,false);

?





style type=text/css

!--



 #navbar ul {

    margin: 0;

    padding: 5px;

    list-style-type: none;

    text-align: center;

    background-color: #000;

    }



#navbar ul li {

    display: inline;

    }



#navbar ul li a {

    text-decoration: none;

    padding: .2em 1em;

    color: #fff;

    background-color: #000;

    }



#navbar ul li a:hover {

    color: #000;

    background-color: #fff;

    }



--

/style



/head



fieldset style=border: 1px ridge limegreen; color: limegreen;
legend style=color: #000; font-family: verdana; font-size:
14pt;EVDO PCMD BANDING/legend body div id=navbar

  ul

    lia href=index.phpHome/a/li

    lia href=dd3.phpEVDO PCMD KPI/a/li

    lia href=banding.phpEVDO Distance Banding/a/li

    lia href=test.phpTEST_BANDING/a/li

    lia href=LinkHere/a/li

  /ul

/div



/fieldset

?php

echo You Selected the following:brMarket = $term brCell_Sector =
$term2brTimestamp = $term3br; ?



img src=bandingGraph.php?$datax=$row[Distance]$datay=$row[MBusage];
// I think this is where I am having issues.





/body

/html

---



My graph script is:



?php // content=text/plain; charset=utf-8

require_once ('jpgraph/jpgraph.php');

require_once ('jpgraph/jpgraph_line.php');



   // Create the graph.

   $graph = new Graph(1024,450,auto);



   $graph-SetScale(textlin);

   $graph-SetShadow();



   // Slightly adjust the legend from it's default position

   $graph-legend-Pos(0.03,0.5,right,center);

   $graph-legend-SetFont(FF_FONT1,FS_BOLD);



   //Setup X-scale

 $graph-xaxis-SetTextTickInterval(10);

 $graph-xaxis-SetTickLabels($datax);

 //$graph-xtick_factor = 1;

    $graph-xaxis-SetLabelAngle(30);



   // Create the linear plot

   $lineplot= new LinePlot($datay);

   $p1 = new LinePlot($datay);

   $p1-mark-SetType(MARK_DIAMOND);

   $p1-mark-SetFillColor(blue);

   $p1-mark-SetWidth(;

   $p1-SetColor(blue);

   $p1-SetCenter();

   $p1-SetLegend(EVDO F1 Carrier);

   $graph-Add($p1);



   // Add the plot to the graph

   $graph-Add($lineplot);



   // Setup margin and titles

   $graph-img-SetMargin(40,40,50,60);

   $graph-title-SetMargin(10);

   $graph-title-Set(Distance in MIles);

   $graph-title-SetFont(FF_VERDANA,FS_BOLD,12);



   // set margin color

   $graph-SetMarginColor('#dcfade');

   // Use built in font

   $graph-title-SetFont(FF_ARIAL,FS_NORMAL,14);

   $graph-ygrid-SetFill(true,'#EFEFEF@0.6','#e5e5e5@0.6');



   $graph-xgrid-Show();

   $graph-SetBackgroundImageMix(15);

   $graph-legend-Pos(0.02,0.03,right,top);

   $graph-legend-SetFont(FF_FONT1,FS_BOLD);







   $graph-xaxis-title-Set(Miles);

   $graph-yaxis-title-Set(MBusage);

   $graph-SetAlphaBlending();



   // Display the graph

   $graph-Stroke();

?





Thank you,



Chris

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Fwd: Object Class Type

2011-03-23 Thread Bruno Sandivilli
-- Forwarded message --
From: Bruno Sandivilli bruno.sandivi...@gmail.com
Date: 2011/3/23
Subject: Object Class Type
To: php-db-sc.1300557321.bdjnjaejefnonigedkec-bruno.sandivilli=gmail.com@
lists.php.net


Hi all, could someone give me a help? I have this scenario: I want to have a
table with objects that are composed of any number of
types(strings,ints,bool,etc) and any number of types(eg: a object Car, may
have 3 types inside(string name, int doors,bool new), and in the same table
could have an object of type House, tha could have 10 types inside);
Thansk!


[PHP-DB] Re: jpgraph and mysql passing array

2011-03-23 Thread David Robley
Chris Stinemetz wrote:

 Hello,
 
 
 
 I hope you can help me. The Jpgraph forum seems to be pretty
 uneventful with participation.
 
 I am trying to pass arrays through the image tag to populate my
 variables for my graph.
 
 I keep getting an error that there is no input. Do you have any
 suggestions?
 
 I would greatly appreciate it! I have been trying to figure this out
 for several hours.
 
 Below is my code:
 
 I need some help with finding a solution. For some reason my graph is
 not showing up when it evident that my arrays are being passed.
 
 When I use:
 
 echo TEST DATA PRINT;
 print_r($datay,false);
 
 ---
 
 I keep getting the error:
 
 Empty input data array specified for plot.
 
 ---
 
 My php script is as follows:
 
 ---
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
 titleKCRF Dashboard/title
 ?php
 ini_set('display_errors', 1);
 error_reporting(E_ALL);
 
 $term=$_POST['term'];
 $term2=$_POST['term2'];
 $term3=$_POST['term3'];
 
 //include ('err_reporting.php');
 require ('PHP_Scripts/config.php');
 require_once ('jpgraph/jpgraph.php');
 require_once ('jpgraph/jpgraph_line.php');
 
 $sql = (SELECT * FROM evdobanding WHERE Market like '%$term' and
 Cell_Sect = '$term2' and Date = '$term3' ORDER BY distance asc);
 
 $result = mysql_query($sql);
 
 while($row = mysql_fetch_array($result))
 {
 $datay[] = $row[MBusage];
 $datax[] = $row[Distance];
 }
 
 echo TEST DATA PRINT;
 
 print_r($datay,false);
 
 ?
snip
 Thank you,
 
 
 
 Chris

If $datay shows as empty, my first step would be to check that your SQL
query doesn't return an empty set.


Cheers
-- 
David Robley

This ocean is calm, said the sailors specifically.
Today is Pungenday, the 10th day of Discord in the YOLD 3177. 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php