Hello
i have a big problem with php and sql server on linux
i have build my app in windwos and php and sql server 2014
it's tow fast and i have no problem on localhost
after i upload to server i see too slow response i don't now why
my conection code is
$ServerN = 'tcp:localhost,1433';
$UserName = 'sa';
$Password = '1';
$DatabaseName = "BellaDataBase2020ELROWAN";
$baseurl = '/' . 'New';
sqlsrv_configure('ClientBufferMaxKBSize',1024*1024);
$connectionInfo = array("Database"=>$DatabaseName,"UID"=>$UserName,"PWD"=>$Password,'CharacterSet'=>'UTF-8',"ConnectionPooling" => "1","MultipleActiveResultSets"=>'0');
$conn = sqlsrv_connect($ServerN, $connectionInfo);
my php code to get table into json
$sql102 = "
SET NOCOUNT ON
SET ARITHABORT OFF;
SET ARITHIGNORE ON;
SET ANSI_WARNINGS OFF;
SELECT [ID],[ITemCode],[Item_Name] FROM Item WHERE [AccountType] = '3' AND [Item_Status] = 'True' ORDER BY [ITemCode] ASC";
$ClientsASCA = sqlsrv_query($conn99,$sql102,array(),array("Scrollable"=>SQLSRV_CURSOR_CLIENT_BUFFERED,"QueryTimeout"=>0)) or die(print_r(sqlsrv_errors(),true));
if (sqlsrv_has_rows($ClientsASCA)) {
while ($fetchItemSST = sqlsrv_fetch_array($ClientsASCA,SQLSRV_FETCH_ASSOC)){
$resultItemSST[] = $fetchItemSST;
}
echo json_encode($resultItemSST);
}
sqlsrv_free_stmt($ClientsASCA);
sqlsrv_close($conn99);
my ajax code
$.ajax({
url: 'Static/CheckValue.php?Type=GetItemValue',
type: "GET",
dataType: "json",
async: true,
cache: true,
processData: false,
contentType: "application/json; charset=utf-8",
error: function (data) {console.log(data);},
complete: function(){$("#ItemNameValue1").append(ItemNameValueA);},
success: function(data) {
if(data.ID != ''){
for (var i = 0; i " + Item_Name + "";
}
}else{
$.each(data.err, function(k, v){
console.log(data);
bootbox.alert({message: "" + v + "",className: 'rubberBand animated',size: 'large'});
});
}
}
});
What I have tried:
i don't know what the problem I'm try a lot of setting
i don't know the problem in php code or on sql server or on this server
remember on local host is to fast