PDO fetchAll array to one dimensional

前端 未结 3 1283
忘掉有多难
忘掉有多难 2020-11-29 03:57

this may be a simple question but am struggling to understand how to solve it. I have a form which allows the user to select either \"custom\" or \"all\" staff\" to assign t

3条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 04:22

    Take a look at example 2 in the manual. In your first query you can use:

    $staff = $select->fetchAll(PDO::FETCH_COLUMN, 0);
    

    And your second array will have the same form as the first array.

提交回复
热议问题