I'm posting what is likely a simple problem but I'm over looking it I think. I've got a small script to post to a URL including what I want my WHERE clause to be defined by, which is then being carried into my SQL command, however I'm getting a message on the page generated stating that my defining information is not a column. My problem is that I should be a column anyway but data held within that column, where the information passed through should be the name of the team, so that the page only shows that one teams information out of x amount of teams... I hope that makes sense.. lets look at the code, hopefully that will be more useful than my ramblings...
SELECTION PAGE CODE
- Code: Select all
<a href="display_team.php?Team_Name=<?php echo $row['Team_Name']; ?>">
<?php echo $row['Team_Name']; ?>
PAGE GENERATED CODE
- Code: Select all
if ($_GET && !$_POST) {
if (isset($_GET['Team_Name'])) {
$Team = $_GET['Team_Name'];
}
else {
$Team = NULL;
}
if ($Team) {
$sql = "SELECT * FROM drivers WHERE Team = $Team";
$result = mysql_query($sql) or die (mysql_error());
$row = mysql_fetch_assoc($result);
}
URL GENERATED
- Code: Select all
http://localhost/FantasyLeagueSoftware/display_team.php?Team_Name=Ferrari
RESULT
- Code: Select all
Unknown column 'Ferrari' in 'where clause'
No idea what I've done wrong, or missing, so if anyone can help then great.
Thank you in advanced.



