Ive ran into a bit of a problem. Im trying to pull data from a column in which values in rows are the same. Ive use SELECT * FROM teams where number=$number
Where $number
is specified by the user. It works on some rows,but some not. Its very weird.
<link rel='icon' href='/image/database_accepted.png' />
<body style="background-color:black">
<?php
include 'includes/connect.php';
//Include the login varibles
//Setup a query for all teams into a varible
$number_select = $_GET['team'];
$query = "SELECT * FROM teams WHERE number='$number_select'";
$result = mysql_query($query);
$test = mysql_fetch_array($result);
if($test==null){
echo "<img src='/image/no_data_found_paramaters.png'>";
}else{
}
?>
<style>
table, th, td {
border: 1px solid black;
}
</style>
<?php
echo "<table bgcolor='#00FF00'>";
echo "<tr>";
echo "<th>Team Name</th>";
echo "<th>Team Number</th>";
echo "</tr>";
echo "<font color='red'>";
while($team = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $team['Name'] . "</td>";
echo "<td>" . $team['Number'] . "</td>";
echo "</tr>";
}
?>
EDIT: Requested operation paste:
CREATE TABLE `teams` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(25) NOT NULL,
`Number` int(4) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8