I'm trying to get data back from the database but I cannot figure out why I'm not getting any output. I'm using jQuery/AJAX:
$(document).ready(function(){
$('#banktransfer_blz').blur( function(){
send_blz( $(this).val() );
} );
} );
function send_blz(str){
$.post( "get_swift.php",
{ sendBLZ: str },
function(data){
$('#banktransfer_bic').val( data.return_bic ).html();
},
"json");
}
And here is the get_swift.php:
if (isset($_POST['sendBLZ'])){
$value = $_POST['sendBLZ'];
}
$test = "test";
$swift = xtc_db_query("SELECT customers_id FROM customers WHERE customers_cid ='20002'");
echo json_encode( array( "return_bic" => $swift) );
I am connected to the database.
xtc_db_query? And don't you need to fetch the data?