This is for questions related to getting the PostgreSQL client libraries and PHP extensions working with PHP
Questions tagged [php-pgsql]
89 questions
1
vote
1 answer
Installing/activitating pgsql.so extension in CentOS 6
I am trying to install a student information system (RosarioSIS) that is PostgreSQL-driven. After installing PostgreSQL 9.6 , the system asks me to install and activate a php extension (pgsql.so). I tried 'yum install php-pgsql' command, but it…

Ragheb Alghezi
- 35
- 7
1
vote
0 answers
Change database port (postgresql) in Mantis
I'm using mantis, and i want to change the port of database, i tried
$g_hostname = '192.168.56.33:5533';
But that didn't work.
Is there any way to change the default port of postgresql database configuration in mantis?

BOUKANDOURA Mhamed
- 941
- 1
- 9
- 25
1
vote
1 answer
YII2 advanced with PGSQL
I am facing this type of error while try to login on live server. Locally everything working fine...
Anyone, please help me... Thank you in advance...

ujash joshi
- 307
- 1
- 14
1
vote
2 answers
php loops - while or do while?
I'm still very new to PHP and pgsql... new to coding in general.
I'm trying to figure out if I should do a while or do while loop on this problem.
I need to query a remote source for data and update my db, but I'm limited to the number of returns…

Dean
- 211
- 2
- 16
1
vote
1 answer
Postgres.app pdo_pgsql pgsql installed but php couldn't find module. MAC OS X
I have problem with Postgres.app.
Postgres.app is running without problems.
In my phpinfo() I can see.
PDO drivers => mysql, odbc, sqlite, pgsql
If I run commat php -m I can see:
...
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
Everything seems to be…

Filip Lukáč
- 100
- 1
- 2
- 13
1
vote
1 answer
Cannot connect to remote PostgreSQL server via PHP
Connecting to a PostgreSQL database via a remote IP address, I have been successful via Windows using pgAdmin III, but I get errors whenever I try connecting from my local CentOS 6 Apache web server using the standard php-pgsql library using…

Jon Lawton
- 890
- 3
- 14
- 33
1
vote
1 answer
Truncate table with constraint in postgresql with php
I have a table where I get data from a rss-feed. I need to truncate the database table before importing, so that I don't have any "old" entries which is not in the rss-feed.
But when I try to truncate, I get an error duplicate key value violates…

Tomas Jacobsen
- 2,368
- 6
- 37
- 81
1
vote
3 answers
Apache unable to load postgres
Today i have updated my MacBook to OS X 10.9.
After the update new configs (httpd.config and php.ini) were added and the old configs was renamed previous. I changed the confignames and everything works finde. Everything? No, postgres were not…

q0re
- 1,401
- 19
- 32
1
vote
0 answers
PDOException Could not find driver in Console Command Symfony2
I am trying to run a Console command. I created command which ran successfully, but when I tried to connect to database, it shows an error on Console:
[PDOException] could not find driver
I am using this to get record from database
$conn =…

Haseeb Jehanzeb
- 319
- 5
- 9
1
vote
1 answer
PostgreSQL permanent connection: usefull in my case?
I have a PHP application which is called with GET parameters running with PG and nginx. The page A receives a message and some information. The page B makes routing. The page C calls an external application with CURL. I will receive up to 1-2…

KuroNeko
- 113
- 2
- 10
0
votes
1 answer
Write PHP code support both MySQL and PostgreSQL without OOP or PDO
I wanted to write a simple forum site with PHP that can be configured to use MySQL or PostgreSQL. Currently there are PDO, but I don't know OOP and I don't want to learn it. I have an idea about a function that take an argument about server…

Someone1611
- 13
- 2
0
votes
1 answer
Callback function not found or invalid name, in set_error_handler
The setup works like this:
There is a Database Class and a Utils Class
The scripts initialize an instance of the Utils Class which initializes the DatabaseConnection instance (I assume that its got something to do with this, as it worked b4 the…

jqlifice
- 13
- 2
0
votes
1 answer
Installing php8.2-pgsql in Codespaces doesn't work first time and workaround to solve it. Should I have done something different?
I'm using Codespaces to develop my project but for some reason I've had a lot of problems to install the pdo_pgsql driver to use Postgress with my symfony project.
Finally, I've found a solution that I've already applied in different codespaces and…

Adrián
- 1
- 1
0
votes
0 answers
Return alphanumeric values as id in postgresql
I have table called tickets with p.k. id and ticket number (i.e. TK0001)
I am using a laravel and for some reason I am required to get the ticket_number as id in response.
Below is my query
SELECT CAST(ticket_number as varchar) as id…

Punit Gajjar
- 4,937
- 7
- 35
- 70
0
votes
0 answers
MVC cannot use any other function than Find and FindOneBy
I have a project to do in PHP (MVC) with my university. Unfortunately, I've been stuck for a week, and nobody in the university knows where the problem is.
Error
Fatal error: Uncaught BadMethodCallException: Undefined method
'persist'. The method…

aa aa
- 1