Forum Moderators: coopster
I have a little problem here that i cant fix by myself. I tried something but i got a false result. So here is my problem, I want to show every goal that the player scored and these are in a table named "info" and i have another table named "calendar" that you have the game number and the team i played against like game 6 i played vs edmonton or game 7 i played against colorado. What i want to do is when i go to the page of a player i see the list of every goal he scored. So this is the my code :
<?php
$db_host = 'localhost';
$db_user = 'root';
$db_pwd = '';
if (!mysql_connect($db_host, $db_user, $db_pwd))
die("Can't connect to database");
mysql_select_db("test");
$face=$_GET['player'].".jpg";
$logo=$_GET['team'].".png";
if(!isset($_GET['player'])) {
echo 'Choisir un joueur';
die;
}
$result = mysql_query("select info.game,info.goal,info.player,calendar.adv from info,calendar where info.game = calendar.game = info." . mysql_real_escape_string($_GET['player'])."") or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0 '>";
echo " <tr>";
echo " <td width='10%'>Match #" . $row["game"] . " VS " . $row["adv"] . "</td>";
echo " <td width='90%'>" . $row["player"] . "</td>";
echo " </tr>";
echo "</table>";
}
mysql_close();
?>
the problem is when i test this page i have an error :
Field 'info.Lang' unknown in where clause
but i need to specify that its Lang's goals i want to see.. i really dont know how to solve this.. i hope i was clear.. im not that good in english
thanks for your help
SELECT
info.game,
info.goal,
info.player,
calendar.adv
FROM
info, calendar
WHERE
info.game = calendar.game
AND
info.player = '$player';