Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Array problem

Comments in 'Plugin Development' started by RekkuzaRage, Jan 13, 2016.

  1. RekkuzaRage
    Offline

    RekkuzaRage Active Member

    Joined:
    Apr 15, 2014
    Posts:
    251
    Minecraft User:
    RekkuzaRage
    Hello PocketMine,

    I am experiencing wired issues while I am trying to store ranks from a AsyncTask MySQL query. Below is the code when I am transferring query data from an array to another array that stores player ranks. I often get array to string conversion issues in the console. I can't really explain this issue well, I just don't get the correct data from the playerRank array. Thanks

    PHP:
    case "syncRanks":
                    
    $this->getRank()->playerRank[$low_username][0] = $data[0]["rank_p"];
                    
    $this->getRank()->playerRank[$low_username][1] = $data[1]["rank_s"];
                    
    var_dump($data[0]["rank_p"]); // Outputs, Alpha (rank)
                    
    var_dump($data[1]["rank_s"]); // Outputs, Citizen (rank 2)
                    
    if($player instanceof Player) {
                        
    $player->sendMessage("§8- §2Ranks successfully synced!");
                        
    $this->getPerm()->setAttachment($player);
                        
    $this->getRank()->setRankPermissions($player);
                    }
                break;
  2. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    Post the MySQL query you are executing
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Could you point out the exact error message and code?

Share This Page

Advertisement