Not able to update PostgreSQL database table from PHP -



Not able to update PostgreSQL database table from PHP -

the next query works in postgresql when run through php, doesn't update. thought might doing wrong? it's first time postgresql.

<?php $connection = pg_connect("host=localhost port=5432 dbname=mydb user=myuser password=mypw"); $sql = "update forum set views = floor(80 + random() * 61) views < 10"; pg_close($connection); // close connection ?>

you need add together

$result = pg_query($connection, $sql);

if doesn't work, adding begin messages. in case add:

pg_query($connection, 'commit');

before disconnecting....

php postgresql

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -