Hirdetés

Keresés

Új hozzászólás Aktív témák

  • abteam2008

    tag

    válasz Sk8erPeter #6482 üzenetére

    Már valamennyit haladtam. Először is van egy xbox_games.php-m:
    <?php require_once('Connections/consolegames.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
    {
    if (PHP_VERSION < 6) {
    $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;
    }
    }

    mysql_select_db($database_consolegames, $consolegames);
    $query_xboxgames = "SELECT gameId, gameTitle, gameGraphic, gameDesc FROM xbox ORDER BY gameTitle ASC";
    $xboxgames = mysql_query($query_xboxgames, $consolegames) or die(mysql_error());
    $row_xboxgames = mysql_fetch_assoc($xboxgames);
    $totalRows_xboxgames = mysql_num_rows($xboxgames);
    ?>

    Body tagben pedig:
    <?php do { ?>
    <a href="xbox_games_details.php?id=<?php echo $row_xboxgames['gameId']; ?>" target= "_BLANK"> <img src="_images/<?php echo $row_xboxgames['gameGraphic']; ?>" width="195" height="262" />
    <?php } while ($row_xboxgames = mysql_fetch_assoc($xboxgames)); ?>

    Ezzel kilistázza a játékborítókat, amelyekre kattintani is lehet (egy ilyen link jön létre kattintásra: http://localhost/consolegames/xbox_games_details.php?id=2)

    Na most már "csak" az xbox_games_details.php-hoz kérnék segítséget. Úgy gondolom, hogy ezzel kellene bekérni az id-t:
    <?PHP
    $id = $_GET['id'];

    Tehát bekérném a gameId-ből az id-t, és az id alapján írná ki az oldalra a játék címét (gameTitle), borítóját (gameGraphic) és rövid leírását (gameDesc).

    Eddig jutottam magamtól, innentől nem tudom tovább.. :(

Új hozzászólás Aktív témák