title: MySQL using PHP join a table to another
body: <p>I need a little bit of help, because I do not know how to join a table to another. I want to output the owner's name from clients table, in the machines table instead of outputting the clients ID. In the clients table owner's name if full_name.
  <a href="https://i.stack.imgur.com/H8Jho.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H8Jho.jpg" alt="how it looks like now" /></a></p>
  <pre><code>&lt;table class=&quot;tbl-full&quot; id=&quot;clients&quot;&gt;
          &lt;tr&gt;
              &lt;th&gt;ID&lt;/th&gt;
              &lt;th&gt;VIN&lt;/th&gt;
              &lt;th&gt;Model&lt;/th&gt;
              &lt;th&gt;Client ID&lt;/th&gt;
              &lt;th&gt;Desc&lt;/th&gt;
              &lt;th&gt;Make&lt;/th&gt;
              &lt;th&gt;Year&lt;/th&gt;
              &lt;th&gt;Actions&lt;/th&gt;
          &lt;/tr&gt;
          &lt;?php
          $sql = &quot;SELECT * FROM machines ORDER BY year DESC&quot;;
          $res = mysqli_query($conn, $sql);
  
          if ($res == TRUE) {
              $count = mysqli_num_rows($res);
              $sn = 1;
  
              if ($count &gt; 0) {
                  while ($rows = mysqli_fetch_assoc($res)) {
                      $id = $rows['id'];
                      $vin = $rows['vin'];
                      $client_id = $rows['client_id'];
                      $model = $rows['model'];
                      $description = $rows['description'];
                      $make = $rows['make'];
                      $year = $rows['year'];
          ?&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;?php echo $sn++; ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $vin; ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $model; ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $client_id; ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $description; ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $make; ?&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;?php echo $year; ?&gt;&lt;/td&gt;
                          &lt;td&gt;
                              &lt;a href=&quot;&lt;?php echo SITEURL; ?&gt;/update-machine.php?id=&lt;?php echo $id; ?&gt;&quot; class=&quot;main-btn&quot;&gt;Update Machine&lt;/a&gt;
                              &lt;a href=&quot;&lt;?php echo SITEURL; ?&gt;/delete-machine.php?id=&lt;?php echo $id; ?&gt;&quot; class=&quot;danger-btn&quot;&gt;Delete Machine&lt;/a&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
  </code></pre>