Kimlik doğrulama veya yönetimden onay bekliyor.
Mysql veritabanımı oluşturuyorum ve phpwebservice ile buradan verileri çekip json halinde almam ve bu verileri mobil uygulamamda göstermem görekiyor.
Kodlar kamp ile denediğimde çalışıyor, ücretsiz bir sitede denediğimde de çalışıyor ancak aynı kodları websiteme eklediğimde çalışmıyor, yani hata vs döndürmeden boş bir sayfa dönüyor. array halindeki verilerim json_encode olmuyor. db_config.php içerisindeki bilgilerim de yanlış değil, anlam veremediğim bir durum var. Bomboş beyaz bir sayfa geliyor. uff-8 ile ilgili şeylerde denedim, hata mesajlarını açtım, postmandan get ile istek aldım ama hepsinde başarısız oluyor acaba neden ? Birde panel c panel acaba sorun bundan mı kaynaklanıyor.
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
// array for JSON response
$response = array();
// require_once __DIR__ . '/db_config.php';
$db = new mysqli('localhost', '', '', '');
$sql = "SELECT * FROM notlar";
$query = $db->query( $sql);
if ($query->num_rows) {
$response["notlar"] = array();
while ($row = $query->fetch_assoc()) {
$notlar = array();
$notlar["not_id"] = $row["not_id"];
$notlar["ders_adi"] = $row["ders_adi"];
$notlar["not1"] = $row["not1"];
$notlar["not2"] = $row["not2"];
array_push($response["notlar"], $notlar );
}
// success
$response["success"] = 1;
// echoing JSON response
echo json_encode($response);
} else {
// no products found
$response["success"] = 0;
$response["message"] = "No data found";
// echo no version JSON
echo( json_encode([
'status' => 'success',
'notlar' => $response
], JSON_UNESCAPED_UNICODE) );
echo json_last_error_msg(); // Print out the error if any
die(); // halt the script
}
?>