phpcat Posted May 28, 2009 Share Posted May 28, 2009 This is a question from a mock PHP exam. Anyone know the answer? When connecting to a database using PDO, what must be done to ensure that database credentials are not compromised if the connection were to fail? CHOOSE 1 a) wrap the PDO DSN in a try/catch block to catch any connection exception b) Use constants in the PDO DSN c) Place the login credentials in the php.ini file e) Disable E_STRICT and E_NOTICE error reporting levels Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/ Share on other sites More sharing options...
Philip Posted May 28, 2009 Share Posted May 28, 2009 Why don't you just post the whole exam? Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843794 Share on other sites More sharing options...
phpcat Posted May 28, 2009 Author Share Posted May 28, 2009 Why don't you just post the whole exam? Because I'm posting questions that I'm unsure about. Unfortunately, the mock PHP exam doesn't tell you which answers are incorrect and what the correct answers are. Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843796 Share on other sites More sharing options...
KevinM1 Posted May 28, 2009 Share Posted May 28, 2009 First, instead of polluting the board with multiple threads, you should consolidate your questions in as few posts as possible, preferably only one. It's bad etiquette to hog the forum. Second, if you actually bothered to read the forum rules (there's a handy link to them in my signature below), you'd know that asking homework questions without attempting to answer them yourself is prohibited. So...what answer would you choose, and why? Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843802 Share on other sites More sharing options...
phpcat Posted May 28, 2009 Author Share Posted May 28, 2009 First, instead of polluting the board with multiple threads, you should consolidate your questions in as few posts as possible, preferably only one. It's bad etiquette to hog the forum. Second, if you actually bothered to read the forum rules (there's a handy link to them in my signature below), you'd know that asking homework questions without attempting to answer them yourself is prohibited. So...what answer would you choose, and why? Flame blah blah blah. Thanks dad. Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843821 Share on other sites More sharing options...
Philip Posted May 28, 2009 Share Posted May 28, 2009 I think his son would be smarter than you, sorry bud. Anyways, we're here to help not to just give away answers. Like Night said, what do you think the answer is, and why? Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843826 Share on other sites More sharing options...
Maq Posted May 28, 2009 Share Posted May 28, 2009 The, "Here's the question, now gimme the answer" threads are frowned upon, not just here but almost any forum. I know it's redundant but like everyone else said, please give your answer and why you think it's right or wrong. Everyone here will help you get the correct answer along with a solid and accurate explanation of why. Therefore, you can apply this concept on other similar questions Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843828 Share on other sites More sharing options...
Ken2k7 Posted May 28, 2009 Share Posted May 28, 2009 You can easily just use choice elimination. I'm sure you can knock down a few of those easily. Edit - couldn't you have just ran a sample test? Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843839 Share on other sites More sharing options...
.josh Posted May 28, 2009 Share Posted May 28, 2009 The answer is d) Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843840 Share on other sites More sharing options...
Philip Posted May 28, 2009 Share Posted May 28, 2009 The answer is d) Haha, good choice! I didn't even notice that Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843842 Share on other sites More sharing options...
Maq Posted May 28, 2009 Share Posted May 28, 2009 Where are you getting these exams from where they don't even know the alphabet? Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843845 Share on other sites More sharing options...
corbin Posted May 28, 2009 Share Posted May 28, 2009 I would imagine he redid the letters himself, but the question appears to be from the Zend Examination Mock Exam thingy.... (Just googled "When connecting to a database using PDO, what must be done to ensure that database credentials are not compromised if the connection were to fail?") Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843848 Share on other sites More sharing options...
Ken2k7 Posted May 28, 2009 Share Posted May 28, 2009 Well there's something the OP could have done. Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843855 Share on other sites More sharing options...
corbin Posted May 28, 2009 Share Posted May 28, 2009 That google query doesn't bring up an answer though ;p. Although I'm sure some google query would. Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843857 Share on other sites More sharing options...
.josh Posted May 28, 2009 Share Posted May 28, 2009 Why are you guys still talking about it? I told you the answer : d) What is d) ? d) get someone else to do it. That is how the real world works and the microcosm that which is this thread proves it. Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-843878 Share on other sites More sharing options...
phpcat Posted May 29, 2009 Author Share Posted May 29, 2009 That google query doesn't bring up an answer though ;p. That's right, a Google query doesn't bring up the answer. And now in the future when people search Google for the same answer, they will find THIS THREAD and NO ANSWER. Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-844694 Share on other sites More sharing options...
Philip Posted May 29, 2009 Share Posted May 29, 2009 The, "Here's the question, now gimme the answer" threads are frowned upon, not just here but almost any forum. (Just googled "When connecting to a database using PDO, what must be done to ensure that database credentials are not compromised if the connection were to fail?") When connecting to a database using PDO, what must be done to ensure that database credentials are not compromised if the connection were to fail? wrap the PDO DSN in a try/catch block to catch any connection exception Use constants in the PDO DSN Place the login credentials in the php.ini file Disable E_STRICT and E_NOTICE error reporting levels rewording the question does amazing things in google. Quote Link to comment https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/#findComment-844700 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.