mysqli::__construct(): (HY000/2002): No such file or directory in <b>/var/www/html/get_koltuk_listesi.php</b> on line <b>13</b><br />
The message appears in the JavaScript console and this error pops up. The strange thing is that there are many parts that connect to SQL, but there is no problem with them. This problem only occurs in this part where I use AJAX.
line 13 is here:
$conn = new mysqli($servername, $username, $password, $dbname,3306);
im %100 sure that connecting informations are all true, exactly the same as what I use elsewhere.And these only happen in the dockerized project. When you run the same project locally, it works without any errors.
and my ajax code is this:
function getKoltukListesi(plaka, tarih) {
var xhr = new XMLHttpRequest();
var url = "get_koltuk_listesi.php";
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
try { console.log("Response from server:", xhr.responseText);
var koltukListesi = JSON.parse(xhr.responseText);
koltukListesiniIsle(koltukListesi); }
catch (e) {
console.error("Parsing error:", e); } }else {
console.error("Server responded with status code", xhr.status); } } };
xhr.open("POST", url, true);
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
var params = "plaka=" + plaka + "&tarih=" + tarih;
xhr.send(params); }