PDO associative arrays - return associative

前端 未结 4 845
我寻月下人不归
我寻月下人不归 2021-01-04 08:37

I have this code:

$dbInstance = DB_Instance::getDBO();
$statement = $dbInstance->prepare(\"SELECT id, name FROM la         


        
4条回答
  •  借酒劲吻你
    2021-01-04 09:00

    I think you might be looking for $result = $sth->fetch(PDO::FETCH_ASSOC);

    Reference: http://php.net/manual/en/pdostatement.fetch.php

    [edit] oops to late :)

提交回复
热议问题