PHP-Code:
<?php require_once('Connections/local.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_spieleliste = 50;
$pageNum_spieleliste = 0;
if (isset($_GET['pageNum_spieleliste'])) {
$pageNum_spieleliste = $_GET['pageNum_spieleliste'];
}
$startRow_spieleliste = $pageNum_spieleliste * $maxRows_spieleliste;
$colname_spieleliste = "-1";
if (isset($_GET['Plattform'])) {
$colname_spieleliste = $_GET['Plattform'];
}
mysql_select_db($database_local, $local);
$query_spieleliste = sprintf("SELECT * FROM spieledb WHERE Plattform = %s", GetSQLValueString($colname_spieleliste, "text"));
$query_limit_spieleliste = sprintf("%s LIMIT %d, %d", $query_spieleliste, $startRow_spieleliste, $maxRows_spieleliste);
$spieleliste = mysql_query($query_limit_spieleliste, $local) or die(mysql_error());
$row_spieleliste = mysql_fetch_assoc($spieleliste);
if (isset($_GET['totalRows_spieleliste'])) {
$totalRows_spieleliste = $_GET['totalRows_spieleliste'];
} else {
$all_spieleliste = mysql_query($query_spieleliste);
$totalRows_spieleliste = mysql_num_rows($all_spieleliste);
}
$totalPages_spieleliste = ceil($totalRows_spieleliste/$maxRows_spieleliste)-1;
$varp = $row_user['id'];
$colname_user = "-1";
if (isset($_GET['user'])) {
$colname_user = $_GET['user'];
}
mysql_select_db($database_local, $local);
$query_user = sprintf("SELECT * FROM osdate_user WHERE username = %s", GetSQLValueString($colname_user, "text"));
$user = mysql_query($query_user, $local) or die(mysql_error());
$row_user = mysql_fetch_assoc($user);
$totalRows_user = mysql_num_rows($user);
$test = $row_spieleliste['ID'];
mysql_select_db($database_local, $local);
$query_Recordset1 = "SELECT user_games_db.GameID, osdate_user.username FROM user_games_db, osdate_user WHERE osdate_user.id = user_games_db.PlayerID AND user_games_db.GameID = '$test' AND osdate_user.username = 'skycryer'";
$Recordset1 = mysql_query($query_Recordset1, $local) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$queryString_spieleliste = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_spieleliste") == false &&
stristr($param, "totalRows_spieleliste") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_spieleliste = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_spieleliste = sprintf("&totalRows_spieleliste=%d%s", $totalRows_spieleliste, $queryString_spieleliste);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
<!--
.Stil1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 24px;
}
-->
</style>
</head>
<body>
<span class="Stil1"><?php echo $row_spieleliste['Plattform']; ?></span> zur Zeit aktiv <?php echo $row_user['username']; ?> mit ID <?php echo $row_user['id'];?><br />
<br />
<table width="660" border="0" cellspacing="2">
<tr>
<td>Spielname</td>
<td>Plattform</td>
<td>Genre</td>
<td>Entwickler</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_spieleliste['Spielname']; ?></td>
<td><?php echo $row_spieleliste['Plattform']; ?></td>
<td><?php echo $row_spieleliste['Genre']; ?></td>
<td><?php echo $row_spieleliste['Entwickler']; ?></td>
<td>crea match</td>
<td>want<?php echo $row_spieleliste['ID']; ?></td>
<td>in list<?php echo $row_Recordset1['GameID']; ?></td>
<td>
<?php
if ($row_spieleliste['ID']==$row_Recordset1['GameID']) {
echo "hey das hast du schon";
} else {
echo "das hast du noch nicht";
}
?></td>
<td> </td>
</tr>
<?php } while ($row_spieleliste = mysql_fetch_assoc($spieleliste)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($spieleliste);
mysql_free_result($user);
mysql_free_result($Recordset1);
?>

Einen Kommentar schreiben: