while ($Row_Permission = mysql_fetch_array($Query_Permission)) {
มันผิดตรงไหนหว่าเนียมันขึ้นแบบเนีย
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/byjvspr123/domains/prompt-organize.com/public_html/webengine/lib/loadpermission.php on line 40
Error: ไม่สามารถติดต่อ
UPDATE system_staff SET system_staff_LastLoginDate='2009-04-03 16:45:10' WHERE system_staff_ID=
[font=Verdana]อันนี้เป็น Code นะครับ[/font]
$System_TableName_Staff = "System_Staff";
$sql = "SELECT * FROM system_staff WHERE ".$System_TableName_Staff."_UserName='".$inputUserName."' AND System_Staff_Status ='Enable' ";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE(Header("Location:../home/home.php"));
$RecordCount=MYSQL_NUMROWS($Query);
if($RecordCount>0) {
$Row=MYSQL_FETCH_ARRAY($Query);
$myPassword=$Row[$System_TableName_Staff."_Password"];
if(crypt($inputPassword, $myPassword) == $myPassword) {
$System_Session_User_ID = $Row[$System_TableName_Staff."_ID"];
$System_Session_UserName = $Row[$System_TableName_Staff."_UserName"];
$System_Session_FullName = $Row[$System_TableName_Staff."_Name"];
$System_Session_Level = $Row[$System_TableName_Staff."_Level"];
$sql = "SELECT *, ".$System_TableName_UserOnPermission."_Permission FROM ".$System_TableName_Menu.
" LEFT JOIN ".$System_TableName_UserOnPermission." ON ".$System_TableName_Menu."_ID=".$System_TableName_UserOnPermission."_MenuID".
" WHERE ".$System_TableName_UserOnPermission."_UserID=".$System_Session_User_ID;
$Query_Permission = mysql_query($sql);
while ($Row_Permission = mysql_fetch_array($Query_Permission)) {
if ($Row_Permission[$System_TableName_UserOnPermission."_Permission"]<>"") {
$System_Session_Permission[$Row_Permission[$System_TableName_Menu."_ModuleKey"]] = $Row_Permission[$System_TableName_UserOnPermission."_Permission"];
} else {
$System_Session_Permission[$Row_Permission[$System_TableName_Menu."_ModuleKey"]] = "Hide";
}
}
$sql = "UPDATE ".$System_TableName_Staff." SET ".$System_TableName_Staff."_LastLoginDate='".getDateNow()." ".getTimeNow()."' WHERE ".$System_TableName_Staff."_ID=$System_Session_User_ID";
$Query=MYSQL_DB_QUERY($System_DataBase_Name,$sql) OR DIE("Error: ไม่สามารถติดต่อ <br>$sql<br>\n");