title: Inserting radio button value into SQL
body: <p>Working out a simple star ratings script. Data not inserting into SQL. I am passing a 'id' in  the url from the form action to coincide with the rating. I'm using GET to retreive that value. I'm using POST to insert the radio button value. I've tested and the url is passing the id. The script runs to completion. SQL is connecting. </p>
  
  <p>index.html</p>
  
  <pre><code>    &lt;form method="POST" action="rating.php?id=&lt;?php echo $id; ?&gt;"&gt;
        &lt;fieldset class="rating"&gt;
            &lt;legend&gt;. . .&lt;/legend&gt;
                &lt;input type="radio" id="star3" name="starno" value="3" onclick="this.form.submit()"/&gt;
                    &lt;label for="star3" title="Meh"&gt;3 stars&lt;/label&gt;
                &lt;input type="radio" id="star2" name="starno" value="2" onclick="this.form.submit()"/&gt;
                    &lt;label for="star2" title="Kinda bad"&gt;2 stars&lt;/label&gt;
                &lt;input type="radio" id="star1" name="starno" value="1" onclick="this.form.submit()"/&gt;
                    &lt;label for="star1" title="Sucks big time"&gt;1 star&lt;/label&gt;
        &lt;/fieldset&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>ratings.php</p>
  
  <pre><code>    &lt;?php
      isset($_GET['id']);
      $con=mysqli_connect ("","","","");
      mysqli_query($con,"INSERT INTO ratings (storyidr, rank, entry_date) VALUES ('$_GET[id]','$_POST[starno]',now())");
      mysqli_close($con);
      header('Location: http://www.website.com/'); 
      ?&gt;
  </code></pre>
  
  <p>SQL</p>
  
  <pre><code>    CREATE TABLE IF NOT EXISTS `ratings` 
      (
        `ratingid` int(11) NOT NULL AUTO_INCREMENT,
        `storyidr` varchar(11) NOT NULL,
        `rank` int(11) NOT NULL,
        `entry_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
      PRIMARY KEY (`ratingid`),
      UNIQUE KEY `ratingid` (`ratingid`)
      ) 
      ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='rating for stories' AUTO_INCREMENT=1 
  </code></pre>