Jump to content

Table - helpsss


june_c21

Recommended Posts

Current Result                                            Expected Result

 

Name    Amount  Total                              Name    Amount  Total

A            15            40                                    A            15       

A            15            40                                    A            15

A            10            40                                    A            10        40

 

how  to edit this code into expected result ??

 

$query="SELECT user.acc_no, report.staff_no, user.name, report.amount FROM user,report WHERE report.staff_no = user.staff_no and status='approve' and user.bank ='Bumiputra Commerce Bank'" ;

$result = mysql_query($query,$dblink);

while($row = mysql_fetch_array($result))

  {

  // $x_pos = $pdf->SetX(50);

  $y_pos = $pdf->GetY();

  $pdf->SetX(40);

  $pdf->Cell(60,6,$row[0],1,0,'C',1);

  $pdf->Cell(50,6,$row[1],1,'C',0);

  $pdf->Cell(60,6,$row[2],1,'C',0);

  $pdf->Cell(20,6,$row[3],1,'C',0);

 

  $query1 = "SELECT SUM(amount) FROM report where staff_no = '$row[1]'and report.status='approve'";

  $result1 = mysql_query($query1, $dblink);

  while($myrow1 = mysql_fetch_row($result1))

{

 

 

  $pdf->Cell(20,6,$myrow1[0],1,'C',0);

  $pdf->Ln();

 

Link to comment
https://forums.phpfreaks.com/topic/77254-table-helpsss/
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.