Unix Technical Forum

php cant see new table!!

This is a discussion on php cant see new table!! within the pgsql Novice forums, part of the PostgreSQL category; --> HI all, Im having a heck of a time here ... Im running PostgreSQL 8.1 on windows XP. I ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 09:36 PM
Sears, Jeremy
 
Posts: n/a
Default php cant see new table!!

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


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 09:36 PM
Michael Fuhr
 
Posts: n/a
Default Re: php cant see new table!!

On Fri, Feb 17, 2006 at 10:55:10AM -0500, Sears, Jeremy wrote:
> 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


Is the table name st.iam or st."IAM"? If you don't understand the
difference then see the section about quoted identifiers in the
documentation:

http://www.postgresql.org/docs/8.1/i...AX-IDENTIFIERS

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:48 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com