Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8828351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:35:10+00:00 2026-06-14T07:35:10+00:00

I am making a PHP website using PDO with PHP but my DSN (for

  • 0

I am making a PHP website using PDO with PHP but my DSN (for Postgresql) isn’t connecting to the database while with Mysql is working fine.

I am trying with the password a b c.

Error: exception ‘PDOException’ with message ‘SQLSTATE[08006] [7] missing “=” after “b” in connection info string’ in /var/www/owncloud/pg_test.php:11
Stack trace:
#0 /var/www/owncloud/pg_test.php(11): PDO->__construct(‘pgsql:dbname=te…’, ‘test’, ‘a b c’)
#1 {main}
it’s working!

Example code:

<?php

/** createuser -d -R -S -P test
* => set password to "a b c"
*/

$dsn = "pgsql:dbname=test;host=localhost";
$user = "test";
$psw = "a b c";
try{
  $db = new PDO($dsn,$user,$psw);
  echo "Oh gosh!\n";
}catch(PDOException $e){
  echo "Error :" . $e."\n";
}

$e_user = addslashes($user);
$e_password = addslashes($psw);
$psw = $user = null;
$dsn .= ";user='$e_user';password='$e_password'";

try{
  $db = new PDO($dsn,$user,$psw);
  echo "it's working!\n";
}catch(PDOException $e){
  echo "Error :" . $e."\n";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:35:11+00:00Added an answer on June 14, 2026 at 7:35 am

    This a bug in php ( no Bug #62479) that When you try to connect to a Postgresql database with a password containing 1 or more spaces, pdo will fail to connect

    you have to use like goget2me (No space in password )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making my own website using html and php, and a database using mysql
I am making a simple Dynamic Website using PHP, where i allow the user
I am making a feedback form for my website using php, I thought that
Alright, I'm making a website using PHP/HTML, and I have some backend AJAX to
I am making a simple login form that saves to a database using MYSQL.
We are making a website using dreamweaver (html, php, javascript, css...) and using mainly
I am creating a website that is using a perl script, PHP, a MySQL
I'm making a website using Facebook Connect php sdk,when i login using face book
I am making a PHP image uploader using the Zend Framework which will upload
I am trying to work on getting better at making HTML forms using PHP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.