I've looked at all the previous examples but still no dice, and I have a basic php question.The example is here. I want to be able to click on one table and have the options appear like below:
Explicitly declaring the table name in this code works:\[code\]if($_GET['action'] == 'getOptions'){ $category = $_GET['category']; $query = "SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='headfirstjson' AND **`TABLE_NAME`='AmericanOilProduction'**"; $result = db_connection($query); //echo $result; $Options = array(); while ($row = mysql_fetch_array($result)) { $Options[] = $row; } echo json_encode(array("Options" => $Options)); exit;}\[/code\]This combination of passing in the variable by AJAX does not:AJAX:\[code\]function getOptions(category){var category = category.value$.ajax({ url: "getData.php?action=getOptions", type: "GET", dataType:"json", data: {category:category}, success: function(json){ $.each(json.Options,function(){ var option = "<option>"+this.COLUMN_NAME+"</option>" $('#options').append(option) }); }});}\[/code\]PHP:\[code\]if($_GET['action'] == 'getOptions'){ **$category = $_GET['category']**; $query = "SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `TABLE_SCHEMA`='headfirstjson' AND `TABLE_NAME`='**.$category.**'"; $result = db_connection($query); //echo $result; $Options = array(); while ($row = mysql_fetch_array($result)) { $Options[] = $row; } echo json_encode(array("Options" => $Options)); exit; }\[/code\]It would be great if someone could help me out! Thanks.