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
Post a Comment