Note that there are some explanatory texts on larger screens.

plurals
  1. POjson_encode is returning NULL?
    primarykey
    data
    text
    <p>For some reason the item "description" returns <code>NULL</code> with the following code:</p> <pre><code>&lt;?php include('db.php'); $result = mysql_query('SELECT * FROM `staff` ORDER BY `id` DESC LIMIT 2') or die(mysql_error()); $rows = array(); while($row = mysql_fetch_assoc($result)){ $rows[] = $row; } echo json_encode($rows); ?&gt; </code></pre> <p>Here is the schema for my database:</p> <pre><code>CREATE TABLE `staff` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` longtext COLLATE utf8_unicode_ci, `description` longtext COLLATE utf8_unicode_ci, `icon` longtext COLLATE utf8_unicode_ci, `date` longtext COLLATE utf8_unicode_ci, `company` longtext COLLATE utf8_unicode_ci, `companyurl` longtext COLLATE utf8_unicode_ci, `appurl` longtext COLLATE utf8_unicode_ci, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci </code></pre> <p>Here is what is echoed out on the page:</p> <pre><code>[{"id":"4","name":"Noter 2","description":null,"icon":"http:\/\/images.apple.com\/webapps\/productivity\/images\/noter2_20091223182720-thumb.jpg","date":"1262032317","company":"dBelement, LLC","companyurl":"http:\/\/dbelement.com\/","appurl":"http:\/\/noter2.dbelement.com"},{"id":"3","name":"Noter 2","description":null,"icon":"http:\/\/images.apple.com\/webapps\/productivity\/images\/noter2_20091223182720-thumb.jpg","date":"1262032317","company":"dBelement, LLC","companyurl":"http:\/\/dbelement.com\/","appurl":"http:\/\/noter2.dbelement.com"}] </code></pre> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload