fork download
  1. <?php
  2.  
  3. //$sql4 = mysqli_query($db, "SELECT account_id,userid,sex,email,group_id,last_ip,unban_time,diasvip,cash2 FROM login ORDER BY account_id WHERE userid = '$userid'");
  4.  
  5. // A simular a recolha dos dados da base de dados
  6. $exibe4 = array(
  7. "account_id" => "1",
  8. "userid" => "2",
  9. "sex" => "3",
  10. "email" => "4",
  11. "group_id" => "5",
  12. "last_ip" => "6",
  13. "unban_time" => "7",
  14. "diasvip" => "8",
  15. "cash2" => "9"
  16. );
  17.  
  18. foreach ($exibe4 as $k => $v) {
  19. $_SESSION[$k] = $v;
  20. }
  21.  
  22. var_dump($_SESSION);
Success #stdin #stdout 0.01s 24400KB
stdin
Standard input is empty
stdout
array(9) {
  ["account_id"]=>
  string(1) "1"
  ["userid"]=>
  string(1) "2"
  ["sex"]=>
  string(1) "3"
  ["email"]=>
  string(1) "4"
  ["group_id"]=>
  string(1) "5"
  ["last_ip"]=>
  string(1) "6"
  ["unban_time"]=>
  string(1) "7"
  ["diasvip"]=>
  string(1) "8"
  ["cash2"]=>
  string(1) "9"
}