What's wrong with this?

From: John Poltorak <jp(at)eyup(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: What's wrong with this?
Date: 2001-01-21 23:50:03
Message-ID: 20010121235003.W85@eyup.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


I'm trying to get a few lines of PHP working which a couple of
people have kindly provided and I can't get it to work.

Here's all it consists of:-

<HTML>
<HEAD>
<TITLE>pg_test</TITLE>
</HEAD>
<BODY>
<?

$connectid = pg_connect("194.164.53.200", "5432", "postgres");

$query = "SELECT townName FROM towns";

$result = pg_exec($connectid, $query);

$row = pg_fetch_array($result,$row);

print($row["townName"]);

?>

If I use a numeric constant, as in:-

print($row[0]);

it works.

Any ideas on what is missing here?

BTW this PHP script should be runnable by anyone on the Internet.

Maybe the problem is due to cross-platform issues...

--
John

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Chris 2001-01-22 00:10:40 Re: What's wrong with this?
Previous Message Praveen Shetty 2001-01-21 21:46:02 Problem...