Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <form action="" method="POST">
  2. Select Year:<select name="sortyear" id="sortyear">
  3. <option value="2012">2012</option>
  4. <option value="2013">2013</option>
  5. <option value="2014">2014</option>
  6. <option value="2015">2015</option>
  7. </select>
  8. Select Week:<select name="week" id="week">
  9. ...</select>
  10.  
  11. <?php $sql = mysql_query("SELECT SUM(credit) AS credit, depot, Date_Format(`timestamp`,'%U%Y') AS period FROM transactions where Date_Format(`timestamp`,'%U%Y')='102013' group by Date_Format(`timestamp`,'%U%Y') DESC"); while($row11 = mysql_fetch_array( $sql ))
  12. {
  13. $credit = $row11['credit'].'<br>';
  14. $depot = $row11['depot'].'<br>';
  15. $period = $row11['period'].'<br>';
  16. }
  17.  
  18. $sortyear = $_REQUEST['sortyear'];
  19. $week = $_REQUEST['week'];?>
  20.  
  21. SELECT ...
  22. ...
  23. WHERE (YEAR(timestamp) = 2013) AND (MONTH(timestamp) = 10)
  24. GROUP BY YEAR(timestamp), MONTH(timestamp)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement