Update your code to something like this, with removing g_iItems from global scope and add parse condition to be sure that all fields are parsed and stored into array:
PHP Code:
ReadFile( )
{
ArrayClear( g_aDatabase );
new g_iItems[ PlayerData ] );
new szConfigs[ 32 ], szFormat[ 64 ], szPlayerData[ 512 ];
get_configsdir( szConfigs, charsmax( szConfigs ) );
formatex( szFormat, charsmax( szFormat ), "%s/%s", szConfigs, g_szFile );
new iFile = fopen( szFormat, "rt" );
if( iFile )
{
while( ! feof( iFile ) )
{
fgets( iFile, szPlayerData, charsmax( szPlayerData ) );
trim( szPlayerData );
if( szPlayerData[ 0 ] == ';' || strlen(szPlayerData) < 10 || ( szPlayerData[ 0 ] == '/' && szPlayerData[ 1 ] == '/' ) )
continue;
if(parse( szPlayerData, g_iItems[Player_Name], charsmax( g_iItems[Player_Name] ), g_iItems[Player_Password], charsmax( g_iItems[Player_Password]), g_iItems[Player_AccessFlags], charsmax( g_iItems[Player_AccessFlags] ), g_iItems[Player_Prefix], charsmax( g_iItems[Player_Prefix] ) ) < 4)
continue;
ArrayPushArray( g_aDatabase, g_iItems );
}
fclose( iFile );
}
}
After that you will have all data stored in array g_aDatabase on wich you will be later iterate read etc.
On the next ReadFile function call, g_aDatabase array will be emptied and filled with new data from file.