repeating values in PHP drilldown
<p>I am relatively new to PHP. I have drilled down a couple of levels through a DB, and i have hit a snag. i cant work out why i am only retrieving one repeated record when there should just be 5 different ones. my code is below...</p>

<pre><code>&lt;?php 

    $sections = $_GET['rid'];
 // Connects to Database 
 mysql_connect("localhost", "root") or die(mysql_error()); 
 mysql_select_db("test") or die(mysql_error()); 
 $data = mysql_query("SELECT question_keywords.rfp_id, question_keywords.section_id, section_name FROM rfp, question_keywords, section WHERE question_keywords.rfp_id = rfp.rfp_id AND section.section_id = question_keywords.section_id AND section.section_id = '$sections'") 
 or die(mysql_error()); 
  echo "&lt;table border=0 cellpadding=15&gt;";
echo "&lt;tr align = center bgcolor=white&gt;
&lt;td&gt;&lt;b&gt;Section ID&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Section Name&lt;/b&gt;&lt;/td&gt;" ; 
 while($row = mysql_fetch_array($data)){
      $sid = $row['section_id'];  //if you have the column names, replace 0 with 'column_name'
      $sname = $row['section_name'];
     # $status = $row['status'];

# inserts value into table as a hyperlink

echo "&lt;tr align = center bgcolor=white&gt;&lt;td&gt;$sid&lt;/td&gt;&lt;td&gt;&lt;a href=view_section_detail.php?sid=$sid&gt;$sname&lt;/a&gt;&lt;/td&gt;";
}

# displays table

print '&lt;/table&gt;';

 ?&gt;
</code></pre>

<p>Any help would be appreciated</p>

<p>Thanks</p>
