I have created a index.php for my login with steam for user to use there steam login for my site to get information like their name, avatar, and steam id the problem i'm having is that the data isn't sending to my database I have made a db.php file with all the right details just it's not storing in my database.
$db = mysql_connect("localhost", "username", "password");
$db = mysql_select_db("mydbname");
echo "
<br/>SmallAvatar: <img src='$player->avatar'/>
<br/>Player ID: $player->steamid
<br/>Player Name: $player->personaname
<br/>Profile URL: $player->profileurl
";
$sql_fetch_id = "SELECT * FROM users_steam WHERE steamid = '$player->steamid'";
$query_id = mysqli_query($db, $sql_fetch_id);
$_SESSION['name'] = $player->personaname;
$_SESSION['steamid'] = $player->steamid;
$_SESSION['avatar'] = $player->avatar;
if (mysqli_num_rows($query_id) == 0) {
$sql_steam = "INSERT INTO users_steam (name, steamid, avatar) VALUES ('$player->personaname', '$player->steamid', '$player->avatar')";
mysqli_query($db, $sql_steam);
}