PHP - Moved: Php Outputting Script
This topic has been moved to Third Party PHP Scripts.
http://www.phpfreaks.com/forums/index.php?topic=320494.0 Similar TutorialsThis topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=348869.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=322742.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=319561.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=318755.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=342772.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=343070.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=321105.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=322839.0 This topic has been moved to Beta Test Your Stuff!. http://www.phpfreaks.com/forums/index.php?topic=352359.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=313684.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=314681.0 This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=307535.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=310049.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=334372.0 I have mysql table with Type, Month, Date, and Quantity. I am doing query, and writing to xml which will pass to chart. My error is coming because for each <row> I need to have same number of child tags. For instance, if there are six months represented in first row (<header>), I need to have six <number> tags in all the following rows, even when there may not be any Quantity for that particular month in mysql table. Right now, if a particular Type in my table doesn't show quantity for some months, than I end up with fewer <number> tags. My php is here, and xml structure below: Code: [Select] //start the XML output print "<chart>"; print "<chart_data>"; //output the first row that contains the years print "<row>"; print "<null></null>"; $category = mysql_query ("SELECT prMonth FROM table1 GROUP BY prMonth ORDER BY prDate"); for ( $column=0; $column < mysql_num_rows($category); $column++ ) { print "<header>".mysql_result ( $category, $column, "prMonth")."</header>"; } print "</row>"; //output row 2 to 4. Each row contains a type name and its data (Qty, Prem, Comm ...) $series = mysql_query ("SELECT prType FROM table1 GROUP BY prType ORDER BY prType"); for ( $row=0; $row < mysql_num_rows($series); $row++ ) { print "<row>"; $type = mysql_result ( $series, $row, "prType"); print "<string>$type</string>"; $data = mysql_query ("SELECT SUM(prQty) FROM table1 WHERE prType='$type' GROUP BY prMonth ORDER BY prDate"); for ( $column=0; $column < mysql_num_rows($data); $column++ ) { // Need to do something here to // get number tags to show zero // when there's no data for that // month print "<number>".mysql_result($data,$column)."</number>"; } print "</row>"; } //finish the XML output print "</chart_data>"; print "</chart>"; XML structu Code: [Select] <chart> <chart_data> <row> ----this row will be the head row---- </null> <header>Month name</header> <header>Month name</header> ... </row> <row> ----this row will start body rows---- <string>Type name</string> <number>total quantity for month, for this type</number> <number>total quantity for month, for this type</number> ... </row> ... </chart_data> </chart> Hello, I'm trying to echo an additional variable using this: $numincorrect = '<div id="incorrectnum">Sorry, that number was not correct.</div>'; I want to incorperate: $code from require('send.php'); I've tried $numincorrect = '<div id="incorrectnum">Sorry, that number was not "$code".</div>'; However, it literally displays $code on output. Many thanks This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=346654.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=351532.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=342897.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=334044.0 |