title: Error: Fetching only 1 variable from db in button
body: <p>My problem is that, i have 3 products from DB. 1 product is supposed to have disabled button, but in total all 3 of them have disabled button which is wrong. I echoed the value of <strong>&quot;$dss2&quot;</strong> and found that it only calls for 1 product shown below here in my picture link.</p>
  <p><strong>$dss2</strong> is supposed to have different value based on its product</p>
  <p>I don't know the problem, because these codes are inside my fetching from the database loop. It would helped me a lot. Been working for this error for days..</p>
  <p><img src="https://i.stack.imgur.com/AXbij.png" alt="" /></p>
  <p><strong>This is my code for fetching the product's details that is inside the fetching from data loop:</strong></p>
  <pre><code>&lt;?php 
      include('connectdb.php');
      $sql = &quot;SELECT * from posted WHERE (seller='$userid') and (prod='$produkto') and (activityset='GROUP')  and (datee = '$araw')&quot;;
      $result = $conn-&gt;query($sql);
      if ($result-&gt;num_rows &gt; 0) {             
      $result = $conn-&gt;query($sql); ?&gt;
      &lt;?php while($data = $result-&gt;fetch_assoc()) { 
      $dc = $data[&quot;dateclick&quot;];
      **$dss2 = $data[&quot;datestart&quot;];**
      $equaldate = $data[&quot;datee&quot;];
      $as2 = $data[&quot;activityset&quot;];
      }} ?&gt;
  </code></pre>
  <p><strong>This is my button code:</strong></p>
  <pre><code>&lt;!-- Group --&gt;
        &lt;?php
        if ($produkto == $row['cartname']) { 
           if ($dss2 &gt; $datetoday) { ?&gt;
          &lt;button type=&quot;button&quot; class=&quot;btn btn-info btn-sm&quot; title=&quot;Return after 1-2 hours&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-4&quot; disabled&gt;Group &lt;?php echo $groupcount ?&gt;/3&lt;/button&gt;
        &lt;?php }
          else { ?&gt;
           &lt;button type=&quot;button&quot; class=&quot;btn btn-info btn-sm&quot; title=&quot;Return after 1-2 hours&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modal-4&quot; disabled&gt;Group &lt;?php echo $dss2 ?&gt;&lt;?php echo $groupcount ?&gt;/3&lt;/button&gt;
        &lt;?php } } ?&gt;
  </code></pre>
  <p>Button code are also inside my fetching loop</p>