I am using this code to get data from the table:
$.ajax({
url: 'includes/search.php', //the script to call to get data
type:"POST",
//data: {email: email}, //you can insert url argumnets here to pass to api.php
//for example "id=5&parent=6"
dataType: 'json', //data format
success: function(data) //on recieve of reply
{
score = data[3]; //get id
name = data[2]; //get name
}
});
and this php with the necessary connection requirements not posted for security reasons:
$email = @$_GET['email'];
$result = mysql_query("SELECT * FROM $tableName WHERE Email = $email");
$array = mysql_fetch_row($result);
echo json_encode($array);
However, I don't have a way to pass a search variable into the php and can only search the db if I replace $email with an actual email address (which works, so the code in the php is fine.
Can anyone let me know a way to do this.
thanks in advance

New Topic/Question
Reply



MultiQuote







|