Page 2 of 2
Re: Help please with PHP...
Posted: Sun Dec 19, 2010 5:32 pm
by Jonah Bron
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");
// ...
Re: Help please with PHP...
Posted: Mon Dec 20, 2010 9:03 am
by makisoustas
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");
// ...
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?
Re: Help please with PHP...
Posted: Mon Dec 20, 2010 9:17 am
by makisoustas
makisoustas wrote: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");
// ...
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?
And why is this code in the game.php page wrong?
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>
Re: Help please with PHP...
Posted: Mon Dec 20, 2010 12:51 pm
by Jonah Bron
mysql_query() doesn't create variables for you. Read that tutorial I gave you.
Re: Help please with PHP...
Posted: Mon Dec 20, 2010 2:42 pm
by makisoustas
Jonah Bron wrote:mysql_query() doesn't create variables for you. Read that tutorial I gave you.
Ok I'll read the tutorial to learn it but what I must put to work?
Re: Help please with PHP...
Posted: Mon Dec 20, 2010 2:55 pm
by makisoustas
Thank you very much the tutorial and you helped me very much!!! Thank you! I done it! Yeah!