Jeg har dette kode som jeg skal have til at gemme alt det den pt printer i én stor tekststreng, denne skal så gemmes i mysql hvor så jeg kort tid efter kan printe det ud som en graf vha noget andet kode jeg har der modtager xml filer.
Nogen der kan vise hvordan jeg addere det her sammen til én stor streng?
<?php
//connect to the database
mysql_connect ( "localhost", "root", "" );
mysql_select_db ( "reviewdb" );
//start the XML output
print "<chart>";
print "<chart_type>line</chart_type>";
print "<chart_guide horizontal='true' vertical='false' thickness='1' color='ff4400' alpha='75' type='dashed' radius='8' fill_alpha='0' line_color='ff4400' line_alpha='75' line_thickness='4' size='10' text_color='ffffff' background_color='ff4400' text_h_alpha='90' text_v_alpha='90'/>";
print "<chart_data>";
//
//output the first row that contains the years
print "<row>";
print "<null/>";
for ( $volt=4; $volt < 13; $volt++ ) {
print "<string>".$volt."V</string>";
}
print "</row>";
//output row 2 to 4. Each row contains a region name and its data
$series = mysql_query ("SELECT fanname, manufacter, CFM_4V, CFM_5V, CFM_6V, CFM_7V, CFM_8V, CFM_9V, CFM_10V, CFM_11V, CFM_12V FROM fanreviews");
for ( $row=0; $row < mysql_num_rows($series); $row++ ) {
$result = mysql_fetch_array($series);
$fanname = $result['fanname'];
$manufacter = $result['manufacter'];
$Name = "$fanname $manufacter";
$CFM4V = $result['CFM_4V'];
$CFM5V = $result['CFM_5V'];
$CFM6V = $result['CFM_6V'];
$CFM7V = $result['CFM_7V'];
$CFM8V = $result['CFM_8V'];
$CFM9V = $result['CFM_9V'];
$CFM10V = $result['CFM_10V'];
$CFM11V = $result['CFM_11V'];
$CFM12V = $result['CFM_12V'];
print "<row>";
print "<string>".$Name."</string>";
print "<number>".$CFM4V."</number>";
print "<number>".$CFM5V."</number>";
print "<number>".$CFM6V."</number>";
print "<number>".$CFM7V."</number>";
print "<number>".$CFM8V."</number>";
print "<number>".$CFM9V."</number>";
print "<number>".$CFM10V."</number>";
print "<number>".$CFM11V."</number>";
print "<number>".$CFM12V."</number>";
print "</row>";
}
//finish the XML output
print "</chart_data>";
print "</chart>";
?>