So today, I'm finally making the transition from standard PHP MySQL functions to PDO. I noticed when fetching data as an object, we must run a line similar to the following:
$STH = $DBH->query('SELECT name, addr, city from folks');
$STH->setFetchMode(PDO::FETCH_OBJ);
$result = $STH->fetch();
My question is regarding line 2. Is there a way to set this as the default behavior so that we don't need to set the fetch mode every single time we wish to run a query? This seems pretty annoying to me. Surely it's not necessary to do this?