Skip site navigation (1) Skip section navigation (2)

php cant see new table!!

From: "Sears, Jeremy" <Jeremy(dot)Sears(at)CCRS(dot)NRCan(dot)gc(dot)ca>
To: "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: php cant see new table!!
Date: 2006-02-17 15:55:10
Message-ID: B7F9814D6850C949947CF8DEA1347781033160ED@s5-ccr-r2.ccrs.nrcan.gc.ca (view raw or flat)
Thread:
Lists: pgsql-novice
HI all,
Im having a heck of a time here ...

Im running PostgreSQL 8.1 on windows XP. 

I have created a new table in an existing database. The existing database
has a few schemas already built and some tables in these schemas. 

I have sucessfully created a new table in a schema known as "st". I can view
the contents of my database and see that this table exists. However when I
attempt to connect to it via php, I get the following error:

Warning: pg_query(): Query failed: ERROR: relation "st.iam" does not exist
in D:\ms4w\Apache\htdocs\postgres\justconnect.php on line 8
There was an error! ERROR: relation "st.iam" does not exist
end script 


When I change my query statement to use a differnt table in the same schema,
it connects without problem.

This is the php code Im running:

<?php

echo 'start script <br>';

pg_connect("dbname=playdb user=postgres password=xxxxx") or die("Couldn't
Connect: ".pg_last_error());
//$query = "SELECT * from st.dictionnary";   //***** this line works
$query = "SELECT * from st.IAM";	    //*****  this line wont work
$query = pg_query($query);
if($query)
  echo "got it!";
else{
  echo "There was an error! ".pg_last_error();
}
echo '<br> end script <br>';

?>

Can anyone suggest a reason why this may be happening? Perhaps Ive missed
something important while creating the table?

Thanks
Jeremy


Responses

pgsql-novice by date

Next:From: ShalerDate: 2006-02-17 16:06:30
Subject: reinstallation of Posstgresql 8.0 program
Previous:From: Arnaud LesauvageDate: 2006-02-17 15:24:02
Subject: Re: Index usage btree+gist ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group