title: Enable a default disabled button - PHP, HTML, jQuery
body: <p>I really need help.</p>
  
  <p>I am trying to have a setup wherein an admin could enable a client's button that is disabled by default. </p>
  
  <p>So far, I have this code below for the admin. It updates the value column (0 by default) in the button table in the database. And this part is successful.</p>
  
  <pre><code>&lt;input name="enable1"  type="submit"   id="button" value="Enable Button" /&gt;
  
  
  &lt;?php
      if(isset($_POST['enable1'])){           
      mysql_query("UPDATE button SET value = '1' WHERE cat_no = 'cat1'"); }
  ?&gt;
  </code></pre>
  
  <p>And the code for the user is written below. My plan is that, when the admin updates the column value into 1, the code below will echo the enabled button, as by the default, the button is disabled. </p>
  
  <p>And this part is a failure, it does not enable the disabled button. And I noticed, that the first echo in the if statement doesn't work, the only thing that is working is the echo in the else statement where the button is disabled.</p>
  
  <pre><code>&lt;?php 
  
      $sql="SELECT value FROM button WHERE cat_no = 'cat1'";
  
  $result=mysql_query($sql) or die(mysql_error());
  
  if ($result == '1'){
      echo '&lt;input name="enable2"  type="submit" class="inputDisabled"        
  
          id="button"  value="Proceed to Next Category" /&gt;' ;}
  
  else {
  
      echo '&lt;input name="enable2"  type="submit" class="inputDisabled"        
  
          id="button"  disabled="disabled"  value="Proceed to Next Category" /&gt;';}                            
   ?&gt;
  </code></pre>
  
  <p>I also tried to search for alternatives like jQuery. But I can't make it work. And if possible, when the admin clicks the button, the user's page will refresh automatically.</p>
  
  <p>Please help. I really need guidance. Thank you.</p>