473,378 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

error messages (not valid postgresql link resoucre)

|I'm trying to run a query on a database using php and postgres functions

||<?php
db_connect();
$stat = pg_exec($connstr,"SELECT WSID from tblWorkstation ");
while ($row = pg_fetch_rows($stat))
{
print("<option> $row[0]</option>");
}
?>

but I get these error messages. I have tested to see if the connection
is still alive and it is.
||

*Warning*: pg_exec(): supplied argument is not a valid PostgreSQL link
resource in */var/www/html/Databasesite2/Untitled-2*.php on line 27 |

*Warning*: pg_fetch_row(): supplied argument is not a valid PostgreSQL
result resource in */var/www/html/Databasesite2/Untitled-2*.php on line 28

And when I try to close the connection I get theses error messages.

*Warning*: pg_close(): 1 is not a valid PostgreSQL link resource in
*/var/www/html/Databasesite2/Untitled-2.php* on line *61*

*Warning*: pg_host(): 1 is not a valid PostgreSQL link resource in
*/var/www/html/Databasesite2/Untitled-2.php* on line *63*

*Warning*: pg_last_error(): 1 is not a valid PostgreSQL link resource in
*/var/www/html/Databasesite2/Untitled-2.php* on line *64*
Failed to close connection to :

My understanding is if it is not a valid link resource that means its
not available via the connection or that connection is not open.

is this right?

Bob

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #1
1 4203
On Mon, 10 May 2004, Robert Morgan wrote:
|I'm trying to run a query on a database using php and postgres functions

||<?php
db_connect();
You don't set $connstr.
$stat = pg_exec($connstr,"SELECT WSID from tblWorkstation ");
while ($row = pg_fetch_rows($stat))
{
print("<option> $row[0]</option>");
}
?>


$dblink = pg_connect("dbname=$pg_db user=$pg_userid password=$pg_password")
or die ("Kein Connect zu DB");

$sql = "DELETE FROM adr where nr = $nr";
$result = pg_exec($dblink, $sql);
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
7
by: Paul | last post by:
I thought this is more of an IE issue but i've had no joy on that group perhaps somebody here will have a clue. If i click a link to a web page embedded in Excel (97 OR 2000) i get the standard...
7
by: Abdul-Wahid Paterson | last post by:
Hi, I have had a site working for the last 2 years and have had no problems until at the weekend I replace my database server with a newer one. The database migration went like a dream and I had...
1
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
0
by: Janning Vygen | last post by:
Hi, i have a question about how to handle postgresql constraint errors in the client app. I found some mails in the archive about it, too. But i have still so many questions about how to do it,...
2
by: Keith Bottner | last post by:
I just reinstalled my system and am in the process of getting PostgreSQL up and running again. During compilation of Postgres I received the following error: .... checking for main in...
1
by: Steve Wolfe | last post by:
On Saturday, our database machine locked up hard on us due to some faulty hardware. Since then, we have been getting messages like this: ERROR: could not access status of transaction 143934068...
18
by: William | last post by:
I have the following javascript function that updates a scroll_list and sends the updated entry (with its index) to a server script ( i.e. http://mkmxg00/cgi/confirmUpload.pl ) for further...
6
by: David Mathog | last post by:
Do any of you happen to have links to compendiums (or heaven forbid, an actual manual) which maps compiler warnings and errors to examples of actual code problems? In this case I'm specifically...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.