Jump to content

june_c21

Members
  • Posts

    280
  • Joined

  • Last visited

    Never

Everything posted by june_c21

  1. How to create when enter staff no, it will automatically generate out the name in the same form ?
  2. User need to enter Details and Amount and i need to difference it with the details. how i suppose to write?
  3. hi, i am doing a simple program to let user entry their travelling claim. how can i notify user when there are duplicate data (they enter same data twice) ?
  4. why when i wrote "SELECT staff_no FROM report" it didn't come out all the data in the database?
  5. ya, i just edit it but it didn't appear all the record in the database. why?
  6. this is the complete code .... $queryAA="SELECT staff_no from report "; $resultAA = mysql_query($queryAA,$dblink); while($rowAA = mysql_fetch_row($resultAA)) { $query="SELECT report.staff_no, user.name, report.details,report.amount FROM user,report WHERE report.staff_no = user.staff_no and status ='approve' and user.bank ='Maybank' and report.staff_no = '$rowAA[0]' " ; // echo $query; $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(50,6,$row[0],1,0,'C',1); $pdf->SetX(90); $pdf->Cell(40,6,$row[1],1,0,'C',0); $pdf->SetX(130); $pdf->Cell(80,6,$row[2],1,0,'C',0); $pdf->SetX(210); $pdf->Cell(20,6,$row[3],1,1,'C',0); } $query1 = "SELECT SUM(amount) FROM report where staff_no = '$rowAA[0]'and report.status='approve'"; $result1 = mysql_query($query1, $dblink); $myrow1 = mysql_fetch_row($result1); { $pdf->SetX(230); $pdf->Cell(20,6,$myrow1[0],1,'C',0); $pdf->Ln(); } }
  7. what's wrong with this line $pdf->Cell(20,6,('%.2f',$myrow1[0]),1,1,'C',0);
  8. hi, in my database it appear 16.10 but why in report (output) it appear 16.1 ?? how to make it to 16.10?
  9. i must user the first loop else the total won't be display.
  10. Account Number Staff No Name Amount Total 1234567890 A Ali 20 1234567890 A Ali 10 1234567890 A Ali 15 45 1234567890 A Ali 20 1234567890 A Ali 10 1234567890 A Ali 15 45 1234567890 A Ali 20 1234567890 A Ali 10 1234567890 A Ali 15 45 this is the repeat result.
  11. ABBBBBBBBABBBBBBBBABBBBBBBBABBBBBBBBABBBBBBBBABBBBBBBBABBBBBBBBABBBBBBBBAAAAABBABBABBABBABAAAAAAAAAAAA sorry to trouble you, hope you can help as i need to complete my assignment today. thanks
  12. $query="SELECT user.acc_no, report.staff_no, user.name, report.amount FROM user LEFT JOIN report on report.staff_no= user.staff_no WHERE status ='approve'and user.bank='maybank'and user.staff_no= '$rowAA[0]'" ; the result will repeat 3 times for each row of record
  13. Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\Web\claim\maybank_report.php on line 62
  14. Parse error: syntax error, unexpected T_STRING in C:\Web\claim\maybank_report.php on line 59
  15. Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\Web\claim\maybank_report.php on line 62
  16. MadTechie ,error with your query...
  17. hi, how come my output is repeating with this code? what's wrong? Please help. thanks $queryAA="SELECT staff_no from report "; $resultAA = mysql_query($queryAA,$dblink); while($rowAA = mysql_fetch_row($resultAA)) { $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 ='Maybank' and report.staff_no = '$rowAA[0]' " ; // echo $query; $result = mysql_query($query,$dblink); while($row = mysql_fetch_row($result)) { // $x_pos = $pdf->SetX(50); $y_pos = $pdf->GetY(); $pdf->SetX(40); $pdf->Cell(50,6,$row[0],1,0,'C',1); $pdf->SetX(90); $pdf->Cell(40,6,$row[1],1,0,'C',0); $pdf->SetX(130); $pdf->Cell(80,6,$row[2],1,0,'C',0); $pdf->SetX(210); $pdf->Cell(20,6,$row[3],1,1,'C',0); }
  18. can you show me the code as i very new to php
  19. 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(); }
  20. it return zero rresult when i put 2 'and' condition
  21. how to write 3 and condition. example : SELECT user.acc_no,report.staff_no, user.name FROM user,report WHERE report.staff_no = user.staff_no and user.bank ='Maybank'and report.status='approve'
  22. $query = "SELECT id, month, start_date, end_date, user.name, report.staff_no,details,amount,gl_code,user.bank,user.acc_no,status FROM user,report WHERE report.staff_no = user.staff_no"; $result = mysql_query($query, $dblink); while($myrow = mysql_fetch_row($result)) { echo "<tr><td><span class=style2>" . $myrow[0] . "</span</td>"; echo "<td><span class=style2>" . $myrow[1] . "</span</td>"; echo "<td><span class=style2>" . $myrow[2] . "</span</td>"; echo "<td><span class=style2>" . $myrow[3] . "</td></span>"; echo "<td><span class=style2>" . $myrow[4] . "</span></td>"; echo "<td><span class=style2>" . $myrow[5] . "</span></td>"; echo "<td><span class=style2>" . $myrow[6] . "</span></td>"; echo "<td><span class=style2>" . $myrow[7] . "</span></td>"; echo "<td><span class=style2>" . $myrow[8] . "</span></td>"; echo "<td><span class=style2>" . $myrow[9] . "</span></td>"; echo "<td><span class=style2>" . $myrow[10] . "</span></td>"; echo "<td><span class=style10>" . $myrow[11] . "</span></td>";
  23. i try left join but it doesn't work
  24. hi, i not sure what wrong with my code , it return empty result. SELECT id, month, start_date, end_date, user.name, report.staff_no,details,amount,gl_code,user.bank,user.acc_no,status FROM user,report WHERE report.staff_no = user.staff_no
×
×
  • 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.