Jump to content

Formatting data


erikjan

Recommended Posts

  Can someone please help me? Thank you in advance.

 

  Withe the following code I retrieve data from a database,

  and do stuff with it.

  There are three sql statements.

  How can I get the formatted output with only one statement?

 

 

 

  $ordernumber=("0701");

 

  $SQL_statement="SELECT COUNT(*) AS nu, SUM(amountofboxesStunningSofia) AS Stu_Sof, SUM(amountofboxesSmokingJoe) AS Smo_Joe [etc . . .]  WHERE ordernumber LIKE  '$ordernumber%'";

  $resultset=mysql_query($SQL_statement);

 

  ... show data for the month January ...

 

   

  $ordernumber=("0702");

 

  $SQL_statement="SELECT COUNT(*) AS nu, SUM(amountofboxesStunningSofia) AS Stu_Sof, SUM(amountofboxesSmokingJoe) AS Smo_Joe [etc . . .]  WHERE ordernumber LIKE  '$ordernumber%'";

  $resultset=mysql_query($SQL_statement);

 

  ... show data for the month Februari ...

     

 

  $ordernumber=("0703");

 

  $SQL_statement2="SELECT COUNT(*) AS nu, SUM(amountofboxesStunningSofia) AS Stu_Sof, SUM(amountofboxesSmokingJoe) AS Smo_Joe [etc . . .]  WHERE ordernumber LIKE  '$ordernumber%'";

  $resultset2=mysql_query($SQL_statement2);

 

  ... show data for the month March ...

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/41435-formatting-data/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.