Since this solution was just creating the include file, I'm including the code here for reference.

  1. <?php

  2. function dbConnect($type) {

  3. if ($type == 'query') {

  4. $user = 'username';

  5. $pwd" = 'password';

  6. }

  7. elseif ($type == 'admin') { // my server doesn't need this: no admins

  8. $user = 'adminusername';

  9. $pwd = 'adminpassword';

  10. }

  11. else {

  12. exit('Unrecognized connection type');

  13. }

  14. // Connection Code

  15. try {

  16. $conn = new PDO('mysql:host=http://host.location.com;

  17.                  dbname=phpsolutions', $user, $pwd);

  18. return $conn;

  19. }

  20. catch (PDOException e) {

  21. echo 'Cannot connect to database';

  22. exit;

  23. }

  24. }

  25. ?>