I would like to ask for a better approach. I am using Yii2 with PostgreSQL, and set all timestamp fields for all table to timestamp with timezone data type. timestamp with time zone NOT NULL DEFAULT …
Tag: postgresql
PHP Insert into PostgreSQL
So it’s probably a really stupid/basic question, but i have this simple PHP function (which works) and inserts data into a PostgreSQL DB. My issue is when it encounters specific data; function …
Insert into DB with PHP and Postgresql
i don’t understand why i can’t insert into DB. I have create a DB with this table: prenotazione (id,nome_rich,cognome_rich,email_rich,oggetto_rich) interni (id,nome_int,cognome_int,email_int) esterni (id,nome_est,cognome_est,email_est) this is my index.php And this is the input.php that i used to insert the data ( and also to connect to DB ) utils.js I have test the connection to DB and i Receive the positive
pgsql extension is not loading
I am trying to use pgsql extension on Windows 10 64-bit (WAPP). I have: restarted Apache uncommented all postgresql extensions in php.ini used LoadFile to load pgsql.dll moved pgsql.dll to Apache bin (I tried both dll from php folder and from postgresql) But still no result. pgsql is visible only in php.exe -m but not in phpinfo(), extension_loaded(), get_loaded_extensions(). My
heroku local does not find pdo_postgres driver
I am trying to use heroku local on mac to run a Symfony project. But unfortunately it does not find the postgresql driver… which is found when I run php app/console server:run Here is the resulting output. How can I solve this? Answer Did you see these ? http://www.somacon.com/p520.php http://www.unixmen.com/solved-php-warning-module-pdo-already-loaded-in-unknown-on-line-0/ Point is that if you have postgres compiled into php
Fetching all parents in simple way with PostgreSQL
I have a table with a hierarchical structure: I want to list all parents of the plan name Paints, so I can build a breadcrumb to navigate back. Using id = 6 I like to get: I’m using postgresql with PHP, and thinking of efficient way to fetch all the parents as simple as possible. Answer Use recursive with query:
Import CSV file to Postgre
I’m writing some PHP code to import a CSV file to a Postgre DB, and I’m getting the error below. Can you help me? Warning: pg_end_copy(): Query failed: ERROR: literal newline found in data HINT: Use “n” to represent newline. CONTEXT: COPY t_translation, line 2 in C:xampphtdocsimporting_csvimportcsv.php on line 21 Answer You need to specify FILE_IGNORE_NEW_LINES flag in file() function
Filter by date today Postgres and PHP
Currently new to Postgres and php Need help on getting current date total of trees to show I just need to count current trees on current date but can’t seem to make it work. Answer I don’t know if I understand what is the problem, but since you say “current date” I guess you are just missing a filter by
Doctrine – Add default time stamp to entity like NOW()
Following the Doctrine guidelines I understand how to set a default value for an Entity, but what if I wanted a date/time stamp? http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/faq.html My problem is my database has a default of NOW() on a field but when I use Doctrine to insert a record the values are null or blank but the rest of the insert happened. Also
How to use ‘interval’ in Doctrine2 Query Builder
In my Symfony2 repository, I’d like to get objects from a schedule table, that have started, but not finished yet. The interval, within the objects should be encountered as ‘not finished’, should be passed as a variable. Using plain SQL, it works like this: Can I achieve the same with DQL / Query Builder? This is what I have so