title: PHP - How to pass the content of a jquery variable into a sql query?
body: <p>I'd like to use the variable bradio in the "Having" clause of my query but i don't know how to get the content of the jquery variable and passe it into my sql query. This is a fragment of my php file. Can you tell me how can I do this?</p>
  
  <p>Thanks</p>
  
  <pre><code>$conn = mysql_connect("localhost","form-test","pass");
  $db = mysql_select_db("form-test",$conn);
  
  ?&gt; 
    &lt;script type="text/javascript"&gt;
  
  
      jQuery.noConflict();
      jQuery(function()
      {
  
      jQuery('#event_form_field-&lt;?php echo $event_id; ?&gt;').click(function() 
      {
      var bradio= jQuery("input[type=radio]:checked").val()
              alert(bradio); });});
             &lt;/script&gt;
   &lt;?php  
  
  $query2 = "SELECT COUNT(wp_events_answer.answer) as rep, wp_events_answer.attendee_id  as idq, wp_events_question.quota as quota2, wp_events_attendee.event_id as ev, wp_events_answer.answer as answ, wp_events_question.id as qst3
      FROM wp_events_answer, wp_events_attendee, wp_events_question
              WHERE wp_events_answer.question_id = wp_events_question.id AND wp_events_answer.attendee_id = wp_events_attendee.id
      HAVING answer = 
      GROUP BY answ;";
  
   $result2 = mysql_query($query2) or die(mysql_error());
  
   while($row2 = mysql_fetch_row($result2)) {
  
  }
  
  ?&gt;
  </code></pre>