mysql - using get to retrieve value in php -


i want retrieve information table using function. it's not working. please, doing wrong?.

  <td><?php echo $row['count(*)']; ?></td>          <td>n<?php echo number_format($row['sum(basic)'],2); ?></td>          <td>n<?php echo number_format($row['sum(hmo)'],2); ?></td>          <td>n<?php echo number_format($row['sum(dha)'],2); ?></td>          <td>n<?php echo number_format($row['sum(tax)'],2); ?></td>          <td>n<?php echo number_format($row['sum(netpay)'],2); ?></td>          <td><a href="view_payroll_month.php?month=<?php echo $row['year(date)'];?>"><?php echo $row['year(date)'];?></a> </td>       	</tr><?php }?>

the second page want the result show in

$year = $_get['year'];      $qry = "select count(*), sum(basic), sum(hmo), sum(pension), sum(dha), sum(tax), sum(netpay), month(date) salary year(date) ='$year' group month(date)";  $run = mysql_query($qry) or die(mysql_error());      <?php while ($row = mysql_fetch_array($run)) {?>         <tr>          <td><?php echo $row['count(*)']; ?></td>          <td>n<?php echo number_format($row['sum(basic)'],2); ?></td>          <td>n<?php echo number_format($row['sum(hmo)'],2); ?></td>          <td>n<?php echo number_format($row['sum(dha)'],2); ?></td>          <td>n<?php echo number_format($row['sum(tax)'],2); ?></td>          <td>n<?php echo number_format($row['sum(netpay)'],2); ?></td>          <td><a href="view_month.php?month=<?php echo $row['month(date)'];?>"><?php echo $row['month(date)'];?></a> </td>       	</tr><?php }?>                                                                    

this work.

<td><?php echo $row['count(*)']; ?></td>         <td>n<?php echo number_format($row['sum(basic)'],2); ?></td>         <td>n<?php echo number_format($row['sum(hmo)'],2); ?></td>         <td>n<?php echo number_format($row['sum(dha)'],2); ?></td>         <td>n<?php echo number_format($row['sum(tax)'],2); ?></td>         <td>n<?php echo number_format($row['sum(netpay)'],2); ?></td>         <td><a href="view_payroll_month.php?year=<?php echo $row['year(date)'];?>">><?php echo $row['year(date)'];?></a> </td>         </tr><?php }?> 

reason: tried pass value in month inside href. , tried retrieve year parameter. change month year inside href. , able retrieve year now. name parameter must equal name parameter.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -