I currently have some JQuery code where I send the variable 'name' to a PHP file, and that PHP file calls the data in row 'name'
//JQuery Code
$('#next').click(function() {
$('#question > h1').load('/php/getQuestion.php', {
name: qty
});
});
//PHP Code Below
$value = (integer)$_POST["name"];
$sql = "SELECT `question_id`, `question` FROM Question WHERE `question_id` =
{$value}";
I want to do a similar call using JQuery's $.getJSON. Currently this is my code:
var requestAnswer = ($.getJSON('[URL HERE]'));
Is there any way I could send the value of 'name' to my PHP code and get only the JSON request from row: 'name'. Something like:
var requestAnswer = ($.getJSON('[URL HERE]'),{ name:2});
I know this example doesn't work.