Bir mysql sorgumun çalışıp çalışmadığını, ancak dosyama yazdığım hata log.log dosyasını yazmamayı bildiğimden, bir hatayı doğru bir şekilde hata günlüğüne yazdırmaya çalışıyorum. i true hataları ayarlamak ve yazdırmak için o dosyayı anlattı altında ben her şeyi kurmak ama burada sonuç elde bilgi bir demet getirir onun mysql sorgusu tanımlanan tümHata günlüğüne değişken nasıl yazılır php
<?php
error_reporting(E_ALL); //to set the level of errors to log, E_ALL sets all warning, info , error
ini_set("log_errors", true);
ini_set("error_log", "/errorlog.log"); //send error log to log file specified here.
include ("connection.php");
$city = $_POST['city'];
$state = $_POST['state'];
$results = array();
if($query = $db->query("SELECT business_id, BusinessName, date, post".
"FROM WolfeboroC.posts".
"JOIN WolfeboroC.users ON users.recid = posts.business_id".
"WHERE city= '$city' && state='$state' ".
"ORDER BY date DESC LIMIT 0, 500"))
{
while($record = $query->fetch_assoc())
{
bir şey yazdırmıyor veritabanı ve sonuçların
$results[] = $record;
}
$query->close();
}
echo json_encode($results);
i hata günlük dosyasına
error_log(print_r($results));
?>
PHP'nin '/' için yazma iznine sahip olduğundan şüpheliyim. Daha iyi bir günlük dosya konumu seçmelisiniz. Belki de __DIR__. '/ errorlog.log' – Phil
__ DIR __ ne yapar ve dosyam 777 – user2354835
https://www.google.com.au/search?q=php+__DIR__. Ben hata günlüğü – Phil