Tagged Questions
0
votes
2answers
22 views
how to get timestamp from user input(FORM) to its actual data?
let say I have a form:
<form ... >
<input type="text" name="date" /> //input here is 2013-06-14 09:00:00
</form>
I assigned it to let say:
$log = new record();
...
0
votes
0answers
18 views
How to recompile the PHP with --with-pgsql [migrated]
I have installed the postgresql, php and apache to Amazon Linux AMI. Now I want to use the phpPgAdmin, it prompts "Your PHP installation does not support PostgreSQL. You need to recompile PHP using ...
0
votes
1answer
30 views
query works on postgresql but not on php
Let's say, I I have this query in my postgresql.
SELECT * FROM logs WHERE user_id = 8328 AND punchin::date = '2013-06-11';
it returns successful.
But when I implent it in PHP:
$sql = "SELECT * ...
5
votes
5answers
3k views
pg_send_query(): Cannot set connection to blocking mode?
I have a long-running script that seems to occasionally report the following NOTICE-level error:
pg_send_query(): Cannot set connection to blocking mode
It seems to continue to send queries ...
2
votes
4answers
60 views
Dynamic input to database
I'm working on an app that lets a user create projects custom to the users needs, the project is basically a form that can be submitted by another user.
I want to allow the user to dynamically create ...
0
votes
1answer
35 views
Use MySQL and PostgreSQL in the same PHP script
I'm trying to do some migrations from an old site to a new site. The old site uses MySQL and the new site uses PostgreSQL. My problem is I wrote a migration script in PHP that queries info from the ...
0
votes
0answers
16 views
pg_close() error? is a sub close closing the 2 connections?
I am currently getting this error: pg_close(): 12 is not a valid PostgreSQL link resource. This is the code that is being executed:
function getProyectosDeUsuarioDAO($idUsuario)
{
$conexion = ...
0
votes
1answer
21 views
encoding php postgres json_encode
I have a problem with my encoding...
Everything is UTF-8 configured, namely my database (postgres) and my php files.
when I execute this script:
$eleves = $serviceManager->getAll('Eleve');
echo ...
0
votes
1answer
34 views
display time from different table
I'm new to the site and hope someone can guide me on the right path. I'm using PostgreSQL and php. right now I need to display time start and time end. but for some reason it doesn't display right. ...
1
vote
1answer
27 views
Test script for transaction concurrency for postgresql
I would like to test some variants of transaction concurrency in PostgreSQL and for that I need a script which would force two transaction to start at exactly the same time. Something that does not ...
0
votes
2answers
37 views
can't get PG connection going in PDO
I am unable to connect to my database. Sure I'm just missing something simple:
$host = "localhost";
$port = "5432";
$db_name = 'db';
$username = "user";
$password = "pass";
$dbh = new ...
0
votes
1answer
52 views
Insert into multiple tables form one query
I am retrieving the SUM of some data from a query. The SUM can have both negative and positive values. I want to insert the positive values to one table and the negative values to another table.
...
8
votes
3answers
299 views
Is there a way to store Arabic dates with Postgres?
I am a PHP developer and I am working on a project in which I need to store Arabic dates in my database.
However, I have created the application and embedded a JavaScript Arabic calender in it.
Now ...
0
votes
1answer
37 views
php saving an image to postgresql and read it back is not working
This must be common asked question, But I could not find from google. We have a table and has photo column in bytea type in postgresql.
We are saving upcoming image with this snippet:
...
0
votes
2answers
519 views
ZF2 How to get last insert id value?
I am stuck with getting last insert id with Zend framework 2 and I gave up on this...
There are tried combinations:
var_dump($this->tableGateway->insert($insert));
...