catfan / Medoo

The lightweight PHP database framework to accelerate the development.
https://medoo.in
MIT License
4.83k stars 1.15k forks source link

Object keys and Medoo #905

Closed renat2985 closed 3 years ago

renat2985 commented 4 years ago

Medoo can do this without additional foreach?

    $result = $this->database->select("single", ["page","content"]);
    foreach ($result as $row) { 
         $object[$row['page']] = $row['content'];
    }
    echo json_encode($object);
catfan commented 3 years ago

Read the index mapping. https://medoo.in/api/select