ลองๆดูแบบที่ผมเขียน
SELECT stock_d.admin.CodeID,
stock_d.admin.AdminID,
stock_d.admin.AdminName,
stock_d.admin.AdminUser,
staffdata.wtbldepttest.DeptID,
staffdata.wtbldepttest.DeptName,
staffdata.tblteamtest.S_DCODE,
staffdata.wtbldepttest.DeptName,
staffdata.tbldivisiontest.DivisionID,
staffdata.tbldivisiontest.DivisionName
FROM stock_d.admin
LEFT JOIN staffdata.tblteamtest ON tblteamtest.Sno = admin.Sno
LEFT JOIN staffdata.wtbldepttest ON wtbldepttest.DeptID = admin.DeptID
LEFT JOIN staffdata.tbldivisiontest ON tbldivisiontest.DivisionID = admin.DivisionID
WHERE (AdminUser='".$_POST['username']."')
AND (AdminPass='".$_POST['password']."')
//// Code MYSQL ให้คุณไป SELECT เอาเองใน Your Databases
$resultAdmin=mysql_query($sqlAdmin,$c1);
$NumAdmin=mysql_num_rows($resultAdmin);