0

セッションをエコーし​​ようとしていますが、表示されません。これは他のすべてのページと同じコードであるため、セッションは機能していると思います。表示される唯一の部分は、「あなたの ID は」と「リーグ ホーム」というテキストだけです。誰かが私のコードの何が問題なのかを理解するのを手伝ってくれますか?

<?php
 // this starts the session 
 session_start();
 $id = $_SESSION['userid'];
 echo "Your id is " . $id;

//this connects to the database
$con = mysql_connect("localhost","yourfan3_jeengle","armyjoe30");
mysql_select_db("yourfan3_demo", $con);

 //gets info for user
 $result = mysql_query("SELECT * FROM League_Info WHERE User_ID = '$id'");  
 $result2 = mysql_fetch_array($result);
 $leaguename = $result2['League'];
 echo $leaguename;
 //$result31 = $result2['Members'];
 //$result32 = $result2['League_Password'];

 //checks if league name exists
 $memberslist = mysql_query("SELECT User_ID FROM League_Info WHERE League = '$leaguename'"); 

?>
<html>
<head>
</head>

<body>
League Home
</body>
</html>
4

3 に答える 3