How to pass field values to apex class by command button?
<p>I need to pass id field value to apex class to delete that row by using command button.</p>

<p><strong>Class:</strong></p>

<pre><code>public class search_delete
{
public string id {get;set;}
public list&lt;account&gt; acc{get;set;}
public search_delete()
{
    acc = new list&lt;account&gt;();        
    acc = [SELECT id,name,phone,industry from account];

}
public void delete_record()
{

acc = [SELECT name,phone,industry from account where id = :id];

delete acc;
}
}
</code></pre>

<p><strong>VP:</strong></p>

<pre><code>&lt;apex:page controller="search_delete" &gt;
 &lt;apex:form &gt;
     &lt;apex:pageBlock &gt;
         &lt;apex:pageBlockTable value="{!acc}" var="a"&gt;
         &lt;apex:column value="{!a.Name}"/&gt;
         &lt;apex:column value="{!a.Phone}"/&gt;
         &lt;apex:column value="{!a.Industry}"/&gt;         
         &lt;apex:column &gt;
             &lt;apex:commandButton value="Delete" Action="{!delete_record}"&gt;
                 &lt;apex:param name="accId" value="{!a.id}"/&gt;
             &lt;/apex:commandButton&gt;
         &lt;/apex:column&gt;
         &lt;/apex:pageBlockTable&gt;
     &lt;/apex:pageBlock&gt;     
 &lt;/apex:form&gt; 
&lt;/apex:page&gt;
</code></pre>

<p>Now i need to pass id value to apex class from Vp page by the click of delete button.
<a href="https://i.stack.imgur.com/oTVRA.png" rel="nofollow">My Output</a></p>