mise_me_fein Posted June 2, 2010 Share Posted June 2, 2010 Hi.....I'm trying the php exam trying and I think maybe I'm taking it too early now Anyways...this sample question: 1. Which of the following methods are used to fetch data from a PDO Statement? fetchColumn() fetchObject() fetch() fetchClass() fetchRow() I'm just getting into PDO stuff but from what I see fetchColumn(), fetchObject() and fetch() could all be right? Can someone explain to me which is right and why it is so? Link to comment https://forums.phpfreaks.com/topic/203589-question-i-cant-figure/ Share on other sites More sharing options...
Daniel0 Posted June 2, 2010 Share Posted June 2, 2010 Is this for real? That's a shitty exam. What value does it have being able to memorize the API? It certainly doesn't make you a good programmer. Anyways, all of them are valid methods, except for fetchClass(). Link to comment https://forums.phpfreaks.com/topic/203589-question-i-cant-figure/#findComment-1066542 Share on other sites More sharing options...
Adam Posted June 2, 2010 Share Posted June 2, 2010 Given the use of language "which of the following methods are (...)" suggests the answer allows multiple answers, and would have to anyway as 4 of those can return data. Link to comment https://forums.phpfreaks.com/topic/203589-question-i-cant-figure/#findComment-1066543 Share on other sites More sharing options...
JonnoTheDev Posted June 3, 2010 Share Posted June 3, 2010 <?php class myPDO extends PDO { public function fetchClass() { // return data } } ?> Now they are all true! What a stupid question. Link to comment https://forums.phpfreaks.com/topic/203589-question-i-cant-figure/#findComment-1067100 Share on other sites More sharing options...
Daniel0 Posted June 3, 2010 Share Posted June 3, 2010 It's talking about methods in the PDOStatement class Link to comment https://forums.phpfreaks.com/topic/203589-question-i-cant-figure/#findComment-1067102 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.