title: How to execute the if condition within heredoc and stored into mysql database for displayin the data in frontend
body: <p>I dont know how to execute the below script</p>
  
  <p>I want to display button like accept,decline in user panel for that I use mysql_fetch_row to display those values in frontend</p>
  
  <p>I want to execute the condition in the below script and insert those form values into the mysql database.</p>
  
  <p>If it executes these values will be displayed in users panel</p>
  
  <p>but at user registration page it fails and displays error messages sql,s1,s2,rec undefined variable
  please any one help how to execute this script and how to conditonal form display buttons in user panel</p>
  
  <pre><code>  &lt;?php
      $str=&lt;&lt;&lt;abc
      $sql=mysql_query("select * from links where column='value'");
      $sq1=mysql_fetch_row($sql);
      $s1=$rec[13];
      $s2='Done';
      if($s1==$s2)
      {
      echo "&lt;form name=f1 method=post action=\"xxx.php\"&gt;
      &lt;input type=hidden name=income value=$rec[value]&gt;
      &lt;input type=submit value=\"Accept\" id=submit2 name=submit2 disabled=\"disabled\"&gt;
      &lt;/form&gt;
      ";
      }
      else
      echo "&lt;form name=f1 method=post action=\"xxx.php\"&gt;
      &lt;input type=hidden name=uname value=$rec[value]&gt;
      &lt;input type=submit value=\"Accept\" id=submit2 name=submit2 /&gt;
      &lt;/form&gt;";
      abc
      ;
      echo $str;
      ?&gt;
  </code></pre>
  
  <p>Main theme of my question satisfying the following criteria</p>
  
  <pre><code>    First I selected column value
      then I fetch the row for values
      I define one variable to check the values with database values
      then I use if condition to check
      if condition is satisfied disable the form button else enable the form button
      I use heredoc to store and display these values
      If once this process is completed it stores to one variable
      Stored variable value is inserted in to mysql database
      and based on the condition automatically user is able to see the form enable/disable    buttons
  </code></pre>
  
  <p>Example:In users panel I want to display  some links and for each link I display one button like accept according to the condition When user click on that button page is executed and display the button as disable</p>
  
  <p>Give me different suggestions</p>
  
  <p>I don't know this is the only way for this solution</p>
  
  <p>If any other solutions are there please suggest me </p>
  
  <p>Need help</p>
  
  <p>Great Thanks.</p>