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

Re: What's wrong with this?

From: Chris <csmith(at)squiz(dot)net>
To: John Poltorak <jp(at)eyup(dot)org>, pgsql-novice(at)postgresql(dot)org
Subject: Re: What's wrong with this?
Date: 2001-01-22 00:10:40
Message-ID: (view raw, whole thread or download thread mbox)
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:-
><? $connectid = pg_connect("", "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

I don't think you need the quotes around the fieldname - 
or try single quotes - print($row['townName']);
its not a cross-platform thing, its a php syntax thing.


Chris Smith

In response to

pgsql-novice by date

Next:From: John PoltorakDate: 2001-01-22 01:31:16
Subject: What's wrong with this? (Pt II)
Previous:From: John PoltorakDate: 2001-01-21 23:50:03
Subject: What's wrong with this?

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