I have a form with a "select" box. When the box is selected, I want the appropriate records from the database to be shown on the same page.There are two files involved: an HTML page that contains the form:\[code\]<form id="theForm"><select id="theDropdown"><option value="http://stackoverflow.com/questions/10557165/biology">Biology</option><option value="http://stackoverflow.com/questions/10557165/chemistry">Chemistry</option><option value="http://stackoverflow.com/questions/10557165/english">English</option></select></form><div id="resultsGoHere"></div>\[/code\]and also contains the jQuery code:\[code\]<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><script type="text/javascript">$(document).ready(function() { $('#theDropdown').on('change', function() { var qString = '{sub: ' + $('#theDropdown option:selected').text() + '}'; $.post('sub_db_handler.php', qString, processResponse); // $('#resultsGoHere').html(qString); }); function processResponse(data) { $('#resultsGoHere').html(data); }});</script>\[/code\]The jQuery code seems to successfully grab the selected value of the select menu and formats a JSON query string, which is printed out if the commented line above is uncommented.Here is the PHP script that is referred to in the \[code\]post\[/code\] command above.\[code\]<?php$con = mysql_connect("localhost","rongilmo_ron","******");if(!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("rongilmo_databases", $con);$sub = $_POST['theDropdown'];$q = "SELECT dbs.db_name, dbs.db_url FROM dbs, subjects, subjects_databasesWHERE subjects.subject_id=subjects_databases.subject_idAND subjects_databases.database_id=dbs.db_idAND subjects.subject_name='$sub'";$r = mysql_query($q);$array = mysql_fetch_row($r);echo json_encode($array);?>\[/code\]I get no results at all. I've tested the query in non-ajax mode, so that isn't the problem.Still new to ajax. I've been working on this for two days and can't seem to make it work, despite reading lots of tutorials and doing a lot of googling.Any help you can offer will be greatly appreciated.