In the "mysql" database there is a field with the type "json" (MySQL 5.7). "PHP" categorically refuses to display this field itself, while if it is banal to remove this field from the sample, everything is fine. I also tried to execute the query in "phpmyadmin" - everything is fine. What could be the problem?
Connection "PHP":
mysql_select_db("datas" ,$db); $sql = mysql_query('SELECT * FROM test',$db); echo '<pre>'; while ($row = mysql_fetch_assoc($sql)) { print_r ($row); } echo '</pre>'; mysql_close($db); PHP connection using mysqli:
$result = $mysqli->query('SELECT * FROM test'); echo '<pre>'; foreach ($result->fetch_all(MYSQLI_ASSOC) as $row){ print_r ($row); } echo '</pre>'; In both cases, everything works if you remove the json field from the selection.
Separately on request:
does not work:
SELECT * FROM testdoes not work:
SELECT jsondata FROM testdoes not work:
SELECT id,name,jsondata FROM testworks:
SELECT id,name FROM test
Php version: 5.3.29
Version of mysql: 5.7.13