Pure PHP » SQL https://www.pure-php.de PHP unconventional Mon, 04 May 2009 08:06:29 +0000 http://wordpress.org/?v=2.8.4 en hourly 1 Google Charts API with PHP /archives/10 /archives/10#comments Thu, 24 Apr 2008 06:47:13 +0000 admin /?p=10 Ludwig Pettersson has written a class that allows you to conveniently create charts with PHP and Google Charts API.
Google Charts is a simple API that lets you create various types of charts. To create a chart, you just need to call a URL with specific parameters and you receive an image back.

This is greatly simplified with a PHP class.


$data = array(
'IE7' => 22,
'IE6' => 30.7,
'IE5' => 1.7,
'Firefox' => 36.5,
'Mozilla' => 1.1,
'Safari' => 2,
'Opera' => 1.4,
);

$chart = new googChart();
$chart->setChartAttrs( array(
'type' => 'pie',
'data' => $data,
'size' => array( 300, 200 )
));
echo $chart;

Die Ausgabe:
Chart

]]>
Ludwig Pettersson has written a class that allows you to conveniently create charts with PHP and Google Charts API.
Google Charts is a simple API that lets you create various types of charts. To create a chart, you just need to call a URL with specific parameters and you receive an image back.

This is greatly simplified with a PHP class.


$data = array(
'IE7' => 22,
'IE6' => 30.7,
'IE5' => 1.7,
'Firefox' => 36.5,
'Mozilla' => 1.1,
'Safari' => 2,
'Opera' => 1.4,
);

$chart = new googChart();
$chart->setChartAttrs( array(
'type' => 'pie',
'data' => $data,
'size' => array( 300, 200 )
));
echo $chart;

Die Ausgabe:
Chart

]]>
/archives/10/feed 0
Calculating Distance with SQL /archives/9 /archives/9#comments Wed, 23 Apr 2008 07:59:55 +0000 admin /?p=9 It sometimes makes work a bit easier when you calculate certain operations directly with SQL.
A practical example is the calculation of distances. In some projects I calculated this with PHP.

It can also be done directly with SQL
SELECT *, SQRT(POW(L2.lat - L1.lat, 2) + POW(L2.lng - L1.lng, 2)) AS Distance

Via

]]>
It sometimes makes work a bit easier when you calculate certain operations directly with SQL.
A practical example is the calculation of distances. In some projects I calculated this with PHP.

It can also be done directly with SQL
SELECT *, SQRT(POW(L2.lat - L1.lat, 2) + POW(L2.lng - L1.lng, 2)) AS Distance

Via

]]>
/archives/9/feed 0