Jump to content

DaviDJ_G

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

DaviDJ_G's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. DaviDJ_G

    Msql Help!!

    There has been a simple mistake here where you have mistaken $_GET['id'] when in the url of the screenshot it has view.php?view= so it should be $_GET['view'] Here i have made changes and also done a check to see if $_GET['view'] exists <?php $id = intval($_GET['view']); // // Checks to see if the ?view= has been set or not // if ( !isset($id) ) { print 'No ID entered.'; include("footer.php"); exit; } // // Query to select the player from the players table // $sql = "SELECT * FROM players WHERE id = $id"; // // puts the query into $result but also checks to see if it fails and returns an error // if ( !($result = mysql_query($sql)) ) { print 'Could not select player from database.'; include("footer.php"); exit; } // // unsets the $sql variable so it doesnt interfere with any other $sql variables set // unset($sql); // // if it has got this far it will put the result of the query into the $view variable // $view = mysql_fetch_array($result);] // // Frees up the result as we have the query results in $view now // mysql_free_result($result); ?> So this is the way to do it and this will now work if you use ?view=1 for showing a player
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.