After getting the value from database the result did not assign to the variable. Below are my codes.. Alerting the arr result returns value but alert the eventimage and speakerimage is empty
var file_data = $('#pic').prop('files')[0];
var form_data = new FormData(); // Create a FormData object
form_data.append('file', file_data); // Append all element in FormData object
$.ajax({
url : serverURL() + "/upload.php",
cache : false,
contentType : false,
processData : false,
data : form_data,
type : 'post',
success : function(arr){
alert(arr[0].result);
imgNewUserPictureName = (arr[0].result);
}
});
var file_data1 = $('#pic1').prop('files')[0];
var form_data1 = new FormData(); // Create a FormData object
form_data1.append('file', file_data1);
$.ajax({
url : serverURL() + "/upload1.php",
cache : false,
contentType : false,
processData : false,
data : form_data1,
type : 'post',
success : function(arr){
alert(arr[0].result);
imgNewUserPictureName1= (arr[0].result);
}
});
var eventimage = imgNewUserPictureName;
var speakerimage = imgNewUserPictureName1;