I am doing a table join on a mysql databse.
I want the results to display just once but it displays each time there is an entry matching the query.
Here is what I have so far:
$descquery = "SELECT streams.name, streams.desc, users.streamnumber FROM streams, users WHERE users.streamnumber = '$_POST[streamnumber]' AND users.streamnumber = streams.name";
$result = mysql_query($descquery) or die(mysql_error());
// Print out the contents of each row into a table
while($row = mysql_fetch_array($result)){
echo $row['name']. " - ". $row['desc'];
echo "<br />";
}
This prints out multiple entries of what I want. Just wondered if theres something im doing wrong?
You have to use the DISTINCT clause, like this: