12.02.2014, 14:26
That is not where the problem comes from. the problem is coming from:
For some reason it always selects the first row
PHP код:
global $mysql; // we are going to use mysql right? :P
if (isset($_GET['Name'])) {
$page = mysqli_escape_string($mysql, (int)$_GET['Name']); // let's make sure that we just get the integer and not a attempt to do sql injection
$query = mysqli_query($mysql, "SELECT * FROM `Users` WHERE `Name` = {$page}");
if(!mysqli_num_rows($query)) { // if the club requested does not exists...
header("Location: ?p=Topscores");
exit;
}
$data = mysqli_fetch_array($query); // $data['ROW_NAME'];
echo $data['Name'];
} else { ?>