На «Хабр Q&A» можно получить ответ на вопрос по любой теме IT от участников сообщества, хорошо разбирающихся в этой теме.
Задавайте вопросы и получайте ответы
if($result->num_rows > 0){
$data = array();
while ($row = $result->fetch_assoc()){
$data[] = json_decode($row['data'], true);
}
print_r($data);
}
Array
(
[0] => Array
(
[q1] => a1
[q2] => a4
[q3] => a4
[q4] => a1
[q5] => a2
[q6] => a2
[q7] => a2
[q9] => a3
[q10] => a2
[q11] => a2
[q12] => a2
[q13] => a2
[q14] => a3
[q15] =>
)
[1] => Array
(
[q8] => a3
[q10] => a1
[q11] => a1
[q12] => a1
[q13] => a1
[q15] =>
)
2020-04-18T15:07:24.011846+00:00 app[web.1]: [18-Apr-2020 15:07:24 UTC] PHP Fatal error: Uncaught PDOException: Could not connect to database (?). in /app/db/rb-sqlite.php:1056
2020-04-18T15:07:24.011860+00:00 app[web.1]: Stack trace:
2020-04-18T15:07:24.012102+00:00 app[web.1]: #0 /app/db/rb-sqlite.php(777): RedBeanPHP\Driver\RPDO->connect()
2020-04-18T15:07:24.012263+00:00 app[web.1]: #1 /app/db/rb-sqlite.php(1080): RedBeanPHP\Driver\RPDO->runQuery()
2020-04-18T15:07:24.012424+00:00 app[web.1]: #2 /app/db/rb-sqlite.php(4245): RedBeanPHP\Driver\RPDO->GetAll()
2020-04-18T15:07:24.012589+00:00 app[web.1]: #3 /app/db/rb-sqlite.php(6180): RedBeanPHP\Adapter\DBAdapter->get()
2020-04-18T15:07:24.013032+00:00 app[web.1]: #4 /app/db/rb-sqlite.php(8051): RedBeanPHP\QueryWriter\AQueryWriter->queryRecord()
2020-04-18T15:07:24.013194+00:00 app[web.1]: #5 /app/db/rb-sqlite.php(9151): RedBeanPHP\Repository->find()
2020-04-18T15:07:24.013340+00:00 app[web.1]: #6 /app/db/rb-sqlite.php(9711): RedBeanPHP\OODB->find()
2020-04-18T15:07:24.013512+00:00 app[web.1]: #7 /app/db/rb-sqlite.php(12272): RedBeanPHP\Finder->find()
2020-04-18T15:07:24.013637+00:00 app[web.1]: #8 /app/index.php(4): RedBeanPHP\Facade::findAll()
2020-04-18T15:07:24.013669+00:00 app[web.1]: #9 {main}
2020-04-18T15:07:24.013792+00:00 app[web.1]: thrown in /app/db/rb-sqlite.php on line 1056
{% set menu = {'/': 'Главная страница', '/doc': 'Документы'} %}
{% for item in menu %}
<a {% if request.path == item %}class="active"{% endif %} href="{{ item }}">{{ menu[item] }}</a><hr>
{% endfor %}