Search the Community
Showing results for tags 'pq_query'.
-
Hi there. I am new at php and postegresql, I have installed postegreSQL 9.3 and wampserver 2.3. I have already enable the postgreSQL extensions. I am trying to acess a database with the name db where is already created a 3 collumn table (text,text,double). I want to insert a value into it using a php code. The php code that i have is this: $dbconn = pg_connect("host=localhost port=5432 dbname=postgres user=postgres password=passss") or die('It was not possible to connect: ' . pg_last_error()); echo 'Connected: ', pg_dbname($dbconn); $query = "INSERT INTO bd( dia, hora, voltagem) VALUES ('18-9-2013', '17:32:37', 302);"; $linha=pg_query($dbconn,$query); pg_close($dbconn); When opening the file in the browser i get: Connected: postgres ( ! ) Warning: pg_query(): Query failed: ERROR: relation "bd" does not exist LINE 1: INSERT INTO bd( ^ in C:\wamp\www\connectDB.php on line 12 Call Stack # Time Memory Function Location 1 0.0005 246472 {main}( ) ..\connectDB.php:0 2 0.0354 247848 pg_query ( ) ..\connectDB.php:12 What am i doing wrong? i dont get it. Does anyone can give me a little help? Thanks in advance
- 1 reply
-
- postgresql
- php
-
(and 2 more)
Tagged with: