i am trying to get data from mysql db using steam login.
database.php
<?php
$link = mysql_connect("localhost", "root", "");
$db_selected = mysql_select_db('3', $link);
mysql_query("SET NAMES utf8");
function fetchinfo($rowname,$tablename,$finder,$findervalue) {
if($finder == "1")
$result = mysql_query("SELECT $rowname
FROM $tablename");
else
$result = mysql_query("SELECT $rowname
FROM $tablename
WHERE `$finder`='$findervalue'");
$row = mysql_fetch_assoc($result);
return $row[$rowname];
}
?>
index.php
<?php
@include_once('database.php');
@include_once('steamauth/steamauth.php');
if(!isset($_SESSION["steamid"])) {
die("0");
}
$user = fetchinfo("steamid");
$steam = $_SESSION["steamid"];
if($user == 0) die("Not found");
$results = mysql_query("SELECT *
FROM `users`
WHERE `steamid`='$steamid'");
$row = mysql_num_rows($results);
echo $row;
?>
<?php
if(!isset($_SESSION['steamid'])) {
echo "<div style='margin: 30px auto; text-align: center;'>Welcome Guest!
Please log in!<br>";
loginbutton();
echo "</div>";
} else {
include ('steamauth/userInfo.php');
?>
<tr>
<td>$steamprofile['steamid']</td>
<td><?=$steamprofile['steamid']?></td>
<td>SteamID64 of the user</td>
</tr>
<tr>
<?php
}
?>
and my database is only steamid & expiration date. I want to logged users can see when it is going to expire + users that are not in mysql tell them "You are not in db".
Thanks guys hope you help me!