I want to pretty much display the number of rounds for a NBA season. I have a database in mysql where the rounds are all stored. There are 2 different table which cannot be joined. One of the tables contains the CURRENT ROUND, which is pretty much what round is happening right now and the other contains all the rounds. When a user goes to select which rounds results they wanna see, they'll click on a select list and taken to that round.
What i want, i want to be able to make it so, the user can only view the present or past round since viewing future results isnt possible. Since they are both on different tables, i thought by getting the current round from a query
$curr = mysql_query("SELECT current
FROM seasons
WHERE year='2014'");
$result = mysql_query($curr);
while($row = mysql_fetch_array($result)){
$sql = mysql_query("SELECT allrounds
FROM fixtures
WHERE allrounds<= '$row['current']'");}
and kinda use it as a variable for the other query, this doesnt seem to be working. This is my select list.
Select a round:
<?php
echo "<select name = 'rounds' id = 'rounds'>\n";
echo "<option value=>Select...</option>\n";
while ($data = mysql_fetch_array($sql, MYSQL_ASSOC))
{echo "<option value='{$data['allrounds']}'>{$data['allrounds']}</option>\n";}
echo "</select>\n";
?>
Is there any way to fix this?