Sorry to bother you,
So i mixed APIs in my code in my first post, i figured it out and i checked my code, now everything is in MYSQL (not with MYSQLI and MYSQL as it was in my first post).
I've got another problem with my code, i've got the following error:
Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) in your code on line 8.
So here's my code, if someone could help me what to do, i would be thankful :)
<?php
session_start();
ob_start();
error_reporting(E_ALL);
require_once 'dbconnect.php';
include_once("apitest/Functions/GTServerInfo.php");
$sql = "SELECT server FROM users WHERE userId = $_SESSION['userId']";
$result = mysql_query($sql);
if (mysql_num_rows($result) > 0) {
// output data of each row
while($row = mysql_fetch_assoc($result)) {
$ip=$row["server"];
}
} else {
echo "0 results";
}
mysql_close($con);
if( !isset($_SESSION['user']) ) {
header("Location: index.php");
exit;
}
?>
Line 8:
$sql = "SELECT server FROM users WHERE userId = $_SESSION['userId']";