Tagged Questions
2
votes
4answers
8k views
How to bind SQL variables in Php?
How to bind SQL variables in Php?
I want to bind variables instead of just building SQL strings.
Anyway to do this in Php?
either MySQL or PostgreSQL answers would help.
Thanks
18
votes
10answers
30k views
PHP not loading php_pgsql.dll on Windows
PHP 5.2.8 is refusing to load php_pgsql.dll, with the following error:
Warning: PHP Startup: Unable to load dynamic library 'D:\PHP\ext\php_pgsql.dll' - The specified module could not be found.
...
1
vote
1answer
266 views
Merge a table and a change log into a view in PostgreSQL
My PostgreSQL database contains a table that stores instances of a registered entity. This table is populated via spreadsheet upload. A web interface allows an operator to modify the information ...
10
votes
5answers
8k views
mysql_insert_id alternative for postgresql
is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks are solving the problem partially by finding the current value of the sequence used in the ID. ...
14
votes
5answers
22k views
Cannot simply use PostgreSQL table name (“relation does not exist”)
I'm trying to run the following PHP script to do a simple database query:
$db_host = "localhost";
$db_name = "showfinder";
$username = "user";
$password = "password";
$dbconn = ...
2
votes
2answers
2k views
PHP array to postgres array
Now php can't work directly wit Postgresql array. For example, php taking postgresql array like
'{"foo","bar"}'
I need simple php function to create multidimensional postgresql array from php ...
2
votes
6answers
1k views
pg_escape_string not working
I want to use pg_escape_string in my password can anyone sugest me hows it is used? in my postgresql insert table
$query = "insert into vmobjects ...
2
votes
1answer
9k views
Postgresql: using 'NULL' value when insert and update rows with prepared statements
sometimes i need to insert into the table some null values, or update them setting the value to NULL.
I've read somewhere in the postgresql documentation that this cant be done, but can be tricket ...
0
votes
2answers
99 views
creating an alert for particular row 1 and not to del from database postgre
I have an user table like this:-
guid | username | password | firstname | lastname | location | emailaddress | userrole
...
4
votes
3answers
430 views
How UPDATE and SELECT at the same time
I need to update some rows of the tables and then display these rows. Is there a way to do this with one single query and avoid this 2 query ? :
UPDATE table SET foo=1 WHERE boo=2
SELECT * from ...
16
votes
2answers
16k views
Get last insert id after a prepared insert with PDO
I'm using PHP PDO with PostgreSQL for a new project.
Given the following function, how can I return the id of the row just inserted?
It doesn't work the way it looks now.
function ...
5
votes
2answers
2k views
Find overlapping date ranges in PostgreSQL
Is this correct?
SELECT *
FROM contract
JOIN team USING (name_team)
JOIN player USING(name_player)
WHERE name_team = ?
AND DATE_PART('YEAR',date_join)>= ?
AND ...
6
votes
1answer
293 views
How do I work with high precision decimals in PHP
I am trying to create a database-driven website with PHP and with data stored in a PostgreSQL database, (accessed with PDO) and I will be needing to store and manipulate high precision decimal numbers ...
4
votes
4answers
9k views
convert any date string to timestamp without timezone
I'm getting xml and rss feeds and putting the data into a database. I've run into two different date formats so far...
Wed, 21 Jul 2010 00:28:50 GMT
And
2010-07-20T17:33:19Z
I'm sure there will ...
3
votes
3answers
7k views
PostgreSQL connection problems
I have very strange problem with my application, upon occasions I get following error when connecting to postgres. This happens without any pattern, often happens when I run some extensive selenium ...