Jump to content

PHP Exam - Databases - What's the answer?


phpcat

Recommended Posts

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 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?")

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.