title: MySQL table, Click on Record to select
body: <p>I have a PHP script that creates a table with the columns <code>name</code>, <code>sales</code>, and <code>cert</code>.
  I have an if statement that only displays an icon in the certificate column against the record of the logged in user. All of this works ok.</p>
  
  <p>Now I want to set it up so when the user clicks the displayed certificate icon, it passes <code>$_POST[year]</code> and <code>$_POST[sales]</code> to the <code>test.php</code> script. I'm trying to use the following code snippet to do this, but I'm having problems:</p>
  
  <pre><code>$form_start="&lt;form name='test' method='post' action='test.php'&gt;";            
  $form_end="&lt;/form&gt;";
  echo "&lt;td&gt;".$row['year']."&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;b&gt;".$row['name']."&lt;/b&gt;&lt;/td&gt;&lt;td&gt;".$row['sales']."&lt;/td&gt;&lt;td&gt;". '&lt;input type="submit"; value='.$row['sales'].'; style="background:url('.$cert_image.'); width: 24px; height: 17px; border: none; no-repeat; /&gt;'."&lt;/td&gt;&lt;/tr&gt;";
  </code></pre>
  
  <p>Can anyone point me in the right direction please?</p>
  
  <p>OK I now have the following code:</p>
  
  <pre><code>$form_start="&lt;form name='test' method='post' action='test.php'&gt;";            
  $form_end="&lt;/form&gt;";
  echo "&lt;td&gt;".$row['year']."&lt;/td&gt;&lt;td&gt;&lt;b&gt;".$row['name']."&lt;/b&gt;&lt;input type='hidden'; name='cYear'; value=".$row['year']."/&gt;&lt;/td&gt;&lt;td&gt;".$row['sales']."&lt;input type='hidden'; name='cSales'; value=".$row['sales']." /&gt;&lt;/td&gt;&lt;td&gt;&lt;input type='image'; src=$cert_image width: 24px; height: 17px; border: none; no-repeat; alt='Click to revive your Annual Table Certificate'; /&gt;&lt;/td&gt;&lt;/tr&gt;";
  </code></pre>
  
  <p>This looks right (at least to me) but when I click on the image file in the table row wanted,nothing happens i.e. the test.php file isn't called by:
      $form_start="";</p>
  
  <p>Anyone have any idea what I'm doing wrong here?</p>