Printing two separate SQL table data on the dynamically populated table - PHP
<p>Can someone please help me on the following code? Simply put, I'm trying to get two separate SQL tables' data, one on the horizontal side (brands) and the other (distributors) on the vertical side of a dynamically populated table.</p>

<p>my issue is, if you go through the code I cant get the text boxes populated under each respective brand name I get to display from the database. The text boxes are appearing only for the first brand name column. </p>

<p>My second issue if how do I assign a unique ID or a name to a dynamically populated text box here?</p>

<pre><code>    &lt;?php
$q=$_GET["q"];

include ("../connection/index.php"); 
$sql="SELECT * FROM distributors WHERE rsm='".$q."'";
$sqlq="SELECT * FROM brands";
$result = mysqli_query($db,$sql) or die ("SQL Error_er1");
$resultq = mysqli_query($db,$sqlq) or die ("SQL Error_er2");

echo "&lt;table border='1'&gt;
&lt;tr&gt;
&lt;th&gt;Distributor&lt;/th&gt;";
"&lt;tr&gt;";
while($rowq = mysqli_fetch_array($resultq))
    {
    echo "&lt;td&gt;" . $rowq['bname'] . "&lt;/td&gt;";

    }
"&lt;/tr&gt;";

while($row = mysqli_fetch_array($result))
  {
  echo "&lt;tr&gt;";
  echo "&lt;td&gt;" . $row['dname'] . "&lt;/td&gt;";
  echo "&lt;td&gt;&lt;input type='text' name='txt1'&gt;&lt;/td&gt;";
  echo "&lt;/tr&gt;";
  }
echo "&lt;/table&gt;";

mysqli_close($db);
?&gt;
</code></pre>
