Jump to content

piheshpi90

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

piheshpi90's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hello everyone. i'm having problem to create a search page. i want to create a search page like this but i dont have the coding source to refer.. can anyone give me the coding for me to refer.... Help Please [attachment deleted by admin]
  2. i want to create function that calculate worker that attend 6 days activity on year B and group it by their gred. so i use this coding but it give wrong result function countSix($a,$f) { $sql = "SELECT * FROM staf_info INNER JOIN aktiviti_staf ON staf_info.id=aktiviti_staf.id INNER JOIN aktiviti ON aktiviti_staf.id_aktiviti=aktiviti.id_aktiviti WHERE staf_info.id_kumpulan = '".$a."' AND year(tarikh_awal) LIKE '%".$f."'"; $query= mysql_query($sql) or die("Error: " .mysql_error()); $row=mysql_num_rows($query); $num=1; $f=0; if($row!=0) { while( $data=mysql_fetch_assoc($query)) { $b=$data['bil_hari']+$data['hari_kursus']; if($b == 6) { $e = countStaf($data['id'],$data['id_aktiviti']); $f = $f + $e; } } } return $f; } function countStaf($c,$d) { $sql = "SELECT COUNT(*) AS STAFCOUNT FROM aktiviti_staf WHERE id = '".$c."' AND id_aktiviti = '".$d."'"; $query= mysql_query($sql) or die("Error: " .mysql_error()); $row=mysql_num_rows($query); $result = mysql_fetch_array($query); return $result['STAFCOUNT']; } i can't seem to find the error.. help me please!! :'(
×
×
  • 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.