Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old January 30th, 2004, 12:10 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Intranet Database

I have built a database in PostgresQL. When I go to view the php pages I built to show results from the database, I can view them fine if I type the ip address into my browser address bar. However, when I put the php pages on my intranet server, keeping the database on the same server it was before, Nothing shows up. No errors or anything. I restarted the postmaster making sure I started it under the postgres username, I edited the pg_hba.conf to make sure I allow my intranet server's ip, I also allowed TCP/IP connections and SSL in the postgresql.conf. I am really at a loss, I have been researching for like 3 days now and can't find an answer. Can someone point me in the right direction? Help please. Thank you.

Reply With Quote
  #2  
Old January 30th, 2004, 12:32 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Intranet Database

Post the code of one of the pages that is not working locally. You may just need to add a little logic to the page to determine what the problem might be.

Reply With Quote
  #3  
Old January 30th, 2004, 12:53 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Intranet Database

Here's the code:

php Code:
Original - php Code
  1.  
  2.  
  3. <!-- Just a query to review records sorted from newest date to oldest -->
  4.  
  5. <?php
  6.  
  7. $database = "innovations";
  8.  
  9. $db_conn = pg_connect("host=address dbname=$database user=username password=password");
  10. if (!$db_conn) {
  11.     echo "Failed connecting to postgres database $databasen";
  12.     exit;
  13. }
  14.  
  15. $qu = pg_query($db_conn, "SELECT * FROM innovations2");
  16.  
  17. $row = 0; // postgres needs a row counter
  18.  
  19. while ($data = pg_fetch_object($qu)) {
  20.     echo $data->id  . " <br /> <b>Name</b>: ";
  21.     echo $data->name . " <br /> <b>Department</b>:  ";
  22.     echo $data->department   . " <br /> <b>Date</b>: (";
  23.     echo $data->date . ")  <br /> <b>Idea</b>: ";
  24.     echo $data->idea . "  <br /> <b>Person/Department Referred to</b>: ";
  25.     echo $data->dept_referred   . " <br /> <b>Date Referred</b>: (";
  26.     echo $data->date_referred   . " ) <br /> <b>Status</b>: ";
  27.     echo $data->status   . "  <br /> <b>Comments</b>: ";
  28.     echo $data->comments   . "  <br /> <b>Initials</b>: ";
  29.     echo $data->initials   . "<br /> <br />";
  30.     $row++;
  31. }
  32.  
  33.  
  34. pg_close ($db_conn);
  35.  
  36. ?>
  37.  

Reply With Quote
  #4  
Old January 30th, 2004, 01:39 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Intranet Database

Just to be clear, you are not getting any db connectivity errors? You have PHP installed? and your DB connect properties are correct? is the db on the intranet as well?

Reply With Quote
  #5  
Old January 30th, 2004, 01:43 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: RE: Intranet Database


Quote:
Just to be clear, you are not getting any db connectivity errors? You have PHP installed? and your DB connect properties are correct? is the db on the intranet as well?


No errors at all. I do have PHP installed, other php pages run fine on the intranet, it just won't show the database results. The DB connect properties are correct. The db is on a seperate server. It works fine if you view it on the server the db is on, just not when you sign in and try to view it from the Intranet server. I was getting can't connect error, but then I restarted the postmaster and they went away. Now it shows the page how it should look, just no results. Very weird.

Reply With Quote
  #6  
Old January 30th, 2004, 02:01 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Intranet Database

This could be permission related. I am not familiar with PostgreSQL but with MYSql, when you access the db from a seperate server, you need to specifically register the seperate server as a host for a user in the db. I am not sure if that helps you!

Are there any PostgrSQL Guru's out there that might be able to help out here?

Reply With Quote
  #7  
Old January 30th, 2004, 02:05 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Intranet Database

I did edit the pg_hba.conf and add the intranet server as a host and trust permissions. Is that what you mean? By the way, thanks for helping me with this. I appreciate it a lot.

Reply With Quote
  #8  
Old January 30th, 2004, 02:20 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Intranet Database

Yes, that is what I was getting at. Double check the changes you made just to be sure there are no errors. (although It doesn't look like you will find any based on the fact that you don't get any errors.)

Reply With Quote
  #9  
Old January 30th, 2004, 02:29 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Intranet Database

OK, here is my suggestion (this is what I would do) Download this PostgreSQL web based DB admin tool

http://phppgadmin.sourceforge.net/

and install it on the intranet box. Then I would attempt connecting to the DB server and running some queries against the db to see if everything is working properly as far as the db goes. Make sure to test the exact queries you are running on the php pages to make sure that they are returning results. This approach will help determine if this is a DB problem or a PHP coding problem. Once you know where the problem lies, it will be easier to fix


Reply With Quote
  #10  
Old January 30th, 2004, 02:34 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Intranet Database

Thanks, I'll give it a whirl. I'll let you know how it goes.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > Intranet Database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT