Tenaciousmug Posted May 31, 2011 Share Posted May 31, 2011 How do you SELECT * FROM table WHERE field='(a jquery value)' All I want to know is to know what gender they clicked on so I could run this query: SELECT * FROM table WHERE gender='whatever they clicked'; Here is my Javascript code: <script> $(document).ready(setupBeginning); function setupBeginning() { $("#rest").hide(); $(".femaleTrigger").click(showRestFemale); $(".maleTrigger").click(showRestMale); } function showRestFemale() { $("#rest").show(); $("#gender").hide(); } function showRestMale() { $("#rest").show(); $("#gender").hide(); } $(function() { $( "#tabs" ).tabs(); }); </script> Now here is my HTML code: <table cellspacing="0" class="news" align="center" id="gender"> <tr> <td colspan="2" style="border-bottom:1px solid #000;"> <center>Click on your gender:<br> </td> </tr> <tr> <td style="border-right:1px solid #000; border-bottom:1px solid #000;" width="300"> <center><b>Male</b></center> </td> <td style="border-right:1px solid #000; border-bottom:1px solid #000;" width="300"> <center><b>Female</b></center> </td> </tr> <tr> <td class="maleTrigger" name="Male" style="border-right:1px solid #000;" width="300" height="400"> <center><img src="http://www.elvonica.com/wardrobe/imgs/maleimage.png"></center> </td> <td class="femaleTrigger" name="Female" style="border-right:1px solid #000;" width="300" height="400"> <center><img src="http://www.elvonica.com/wardrobe/imgs/femaleimage.png"></center> </td> </tr> </table> <table cellspacing="0" class="news" align="center" id="rest"> <tr> <td height="400px" width="300" style="border-right:1px solid #000;"> <center><img src="#" alt="image"></center> </td> <td height="400px" width="300" valign="top"> <div id="tabs"> <ul> <li><a href="#bases">Base</a></li> <li><a href="#eyes">Eyes</a></li> <li><a href="#mouths">Mouth</a></li> <li><a href="#noses">Nose</a></li> <li><a href="#hairs">Hair</a></li> </ul> <div id="bases"> <p>Bases here.</p> </div> <div id="eyes"> <p>Eyes here.</p> </div> <div id="mouths"> <p>Mouths here.</p> </div> <div id="noses"> <p>Noses here.</p> </div> <div id="hairs"> <p>Hairs here.</p> </div> </div> </td> </tr> </table> Now I want to use PHP to SELECT * FROM tablename WHERE gender='whatever they clicked'; How would I receive the data of what gender they clicked on? Quote Link to comment https://forums.phpfreaks.com/topic/238042-php-with-jquery-selecting/ Share on other sites More sharing options...
.josh Posted June 1, 2011 Share Posted June 1, 2011 You need to make an AJAX call to your php script. Lots of AJAX tutorials out there. Quote Link to comment https://forums.phpfreaks.com/topic/238042-php-with-jquery-selecting/#findComment-1223582 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.