PHP PDO retrieves duplicate data

后端 未结 2 866
挽巷
挽巷 2020-12-12 03:50

I have this situation with PHP (PDO);

I\'m implementing a method that retrieves data from MySql and does it well, but the problem is that duplicate data recovered as

2条回答
  •  醉酒成梦
    2020-12-12 04:26

    change pdo attribute accoding to requirment. . .

     $dbConnection = new PDO( 'pgsql:host=' . $host . ';dbname=' . $database, $username, 
     $password, );
    
     $dbConnection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
    

    set / change PDO attribute more detail here

提交回复
热议问题