0
<?php

$con = mysqli_connect("localhost", "alsmwsk3", "skrktkzl12", "alsmwsk3");
$result = mysqli_query($con, "select * from NOTICE ORDER BY noticeDate DESC");
$response = array();

$num = 0;


while($row = mysqli_fetch_array($result))
{
    array_push($response, array("noticeContent"=>$row[0],"noticeName"=>$row[1],"noticeDate"=>$row[2]));
    echo $num;                                 
}

//php를 읽었을떄 json타입이 아닐 readed php not but json?
//print (json_encode($response));
//    echo json_encode(array("response"));

echo json_encode(array("response"=>$response));
mysqli_close($con);

?>

when I open this phpsource on browser there are no data on browser I think am i wrong some kind of miss?

open on browser but not data

and it is mysql setting

Mysql database table

Barmar
  • 741,623
  • 53
  • 500
  • 612
Seo woo
  • 11
  • 4
  • Try viewing your log files, /var/log/apache2/error.log or enable error output in the browser https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display – Bolli Apr 30 '18 at 23:53
  • Why output "0" 3 times? - just curious... – TCooper Apr 30 '18 at 23:54
  • 1
    I cringe whenever I see `SELECT *` and then numeric indexes in `$row`. The code will break if the order of columns ever changes in the table. Use associative arrays. – Barmar Apr 30 '18 at 23:55
  • Then how should i do? – Seo woo May 01 '18 at 01:28

0 Answers0