'; $information .= "\n"; //teacher $information .= "\n"; $dsn_name = "staff"; $username =""; $password =""; $connect= odbc_connect($dsn_name, $username, $password) or die("µÔ´µèÍ DSN äÁèä´é"); $sql = "SELECT *,TEmployee.id as tempid,TPrefix.name as prefixname FROM TEmployee,TWorkStatus,TPosScale,TPrefix WHERE (TEmployee.work_status=TWorkStatus.id) and (TEmployee.Id=TPosScale.TEmp_id) and (TEmployee.Prefix_id=TPrefix.id) and (TWorkStatus.id = '0') and (TEmployee.id like '01%') and (TPosScale.TDep_id = '0702')"; $execute = odbc_exec($connect, $sql) or die ("àÍç¡«Ô¤ÔÇÊì¤ÓÊÑè§äÁèä´é"); $i=1; $num1=0; while($row = odbc_fetch_array($execute)) { $num1++; $id=$row["tempid"]; $idx=$row["idx"]; $prefixname=$row["prefixname"]; $name=$row["fname"]; $surname=$row["lname"]; $information .= "\n"; $information .= "\n"; $information .= "$id"; $information .= "\n"; $information .= "\n"; $information .= "$idx"; $information .= "\n"; $information .= "\n"; $information .= "$prefixname"; $information .= "\n"; $information .= "\n"; $information .= "$name"; $information .= "\n"; $information .= "\n"; $information .= "$surname"; $information .= "\n"; $information .= "\n"; } // ¨º loop $information .= "\n"; $information .= "\n"; $information .= "$num1"; $information .= "\n"; $information .= "\n"; echo "$information"; ?>