php-windows Digest 16 Nov 2009 15:25:55 -0000 Issue 3722
Topics (messages 29695 through 29696):
Re: writing XML file from MySQL data - foreach loop?
29695 by: Richard Quadling
Cambios de la cuenta de correos
29696 by: Deivys Delgado Hernández
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
2009/11/5 David Hine <david.h...@landandwater.com.au>:
> Dear All
> I wish to use java charts to display some time series data that is stored in
> a MySQL database. The time series is the evapotranspiration (average value
> for each day) at a large banana plantation. This will help guide irrigation.
>
> The java charts use an XML file for the data and the formatting.
>
> I have limited the records to 29 days:
> $query = "SELECT DATE_FORMAT(dt, '%d-%m-%Y') AS Day, AVG(ET) as ET FROM
> database.tablename WHERE DATE(dt) BETWEEN DATE_SUB(NOW(), INTERVAL 30 DAY)
> AND DATE(NOW()) GROUP BY DATE(dt)";
>
> I use a new DomDocument to format the output.
>
> Once I have the structure of the standard part of the document (calling the
> chart and giving some parameters to it) I want to have a series of strings
> like
> <number>1.7</number>
> <number>1.8</number>
> <number>2.1</number>
> etc for 29 times....
>
> For that purpose I wrote:
>
> $row = $doc->createElement( "row" );
> $chart_data->appendChild( $row );
>
> $number = $doc->createElement( "number" );
> while ($row_etdata = mysql_fetch_array($etdata)){
> $row->appendChild( $number );
> $txtnode = $doc->createTextNode("$ET");
> $number->appendChild($txtnode);
>
> When I run this or a variant, I get for example <number 1.71.71.71.71.7 for
> 29 times /> Half right is still wrong. Have considered serialize but that
> has its own complexities.
>
> Your assistance or guidance on solving this would be much appreciated.
> thanks
> David Hine
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Take a look at
http://dev.mysql.com/tech-resources/articles/xml-in-mysql5.1-6.0.html#xml-5.1-exporting
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
--- End Message ---
--- Begin Message ---
Hola, debido a cambios en los servidores de salud he tenido que cambiar mi
cuenta de correos, la nueva cuenta es la siguiente:
de...@dmssb.cmw.sld.cu
La cuenta vieja sera cancelada dentro de mas o menos 15 dias
Saludos,
René y Deivys
--
Este mensaje ha sido analizado por MailScanner Nodo Finlay, Camaguey, Cuba
en busca de virus y otros contenidos peligrosos,
y se considera que está limpio.
Visite nuestro sitio http://nodofinlay.cmw.sld.cu
--- End Message ---