Jump to content

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
https://forums.phpfreaks.com/topic/159972-php-exam-databases-whats-the-answer/
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?

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.

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

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

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.

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.