I'm trying to get data from a database using PHP, then use JSON to show it in a array. The problem is when I remove the comment-tags on one of the 3 rows, none of the text does'nt longer appear in the browser.. Why?
<?php
    //koble til database
    $mysqli = mysqli_connect('localhost', 'root', '','dump');
    //Lager query til databasen
    $select = mysqli_query($mysqli,'SELECT * FROM authors,articles    WHERE authors.author_id = articles.author_id ORDER BY articles.author_id AND articles.article_id ASC');  
    //Oppretter liste
    $rows=array();
    while($row=mysqli_fetch_array($select))
    {
        $rows[] = array('Forfatter_id' => $row['author_id']);
        $rows[] = array('Fornavn' => $row['first_name']);
        //$rows[] = array('Etternavn' => $row['last_name']);
        $rows[] = array('Artikkel_id' => $row['article_id']);
        //$rows[] = array('Tittel' => $row['title']);
        //$rows[] = array('Innhold' => $row['content']);
        $rows[] = array('Publisert' => $row['publish_date']); 
    }
    //Output
    //echo '<pre>';  
    //print_r($rows);  
    //echo '</pre>'; 
    echo json_encode($rows, JSON_PRETTY_PRINT);  
    error_reporting(E_ALL);
    ini_set('display_errors', '1'); 
?>
Any ideas?
 
     
    
'; print_r($rows); echo ''; Everything shows. With some text I don't want, but it shows – Aromefraise Oct 05 '16 at 04:36