Code: Select all
// ...
$id = intval($_GET['game']);
$result = mysql_query("SELECT * FROM games_table WHERE id = $id");
// ...Moderator: General Moderators
Code: Select all
// ...
$id = intval($_GET['game']);
$result = mysql_query("SELECT * FROM games_table WHERE id = $id");
// ...Apart from these must I put something in the game page? And can I use the html <a href></a> and not the php echo on the homepage?Jonah Bron wrote:The row with the ID you got from $_GET['game'].
Code: Select all
// ... $id = intval($_GET['game']); $result = mysql_query("SELECT * FROM games_table WHERE id = $id"); // ...
And why is this code in the game.php page wrong?makisoustas wrote:Apart from these must I put something in the game page? And can I use the html <a href></a> and not the php echo on the homepage?Jonah Bron wrote:The row with the ID you got from $_GET['game'].
Code: Select all
// ... $id = intval($_GET['game']); $result = mysql_query("SELECT * FROM games_table WHERE id = $id"); // ...
Code: Select all
<html>
<body>
<?php
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("games") or die(mysql_error());
$id = intval($_GET['game']);
$result = mysql_query("SELECT * FROM online WHERE id = $id");
echo "$code";
?>
</body>
</html>Ok I'll read the tutorial to learn it but what I must put to work?Jonah Bron wrote:mysql_query() doesn't create variables for you. Read that tutorial I gave you.