D
D
Daniil Sukhikh2018-02-26 22:00:05
PHP
Daniil Sukhikh, 2018-02-26 22:00:05

How to display data from the database in the form of such an array?

There is a database, like this:
5a9459061171f950631569.jpeg
How to display this data in such an array:

[
    'id' => 1,
    'name' => 'name1',
    'desc' => '1desc',
  ],
  [
    'id' => 2,
    'name' => 'name2',
    'desc' => '2desc',
  ],
  ];

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
synapse_people, 2018-02-26
@danchiksux

select `id`, `name`, `desc` from table
var_dump($result)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question