What's wrong with this? (Pt II)

From: John Poltorak <jp(at)eyup(dot)org>
To: pgsql-novice(at)postgresql(dot)org
Subject: What's wrong with this? (Pt II)
Date: 2001-01-22 01:31:16
Message-ID: 20010122013116.X85@eyup.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Folloing a number of suggestions from various people I tried
ammending my original code and now have:-

<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("using element 0 :- \n");

print($row[0]);

print("<BR>");

print("using double quotes :- \n");

print($row["townName"]);

print("<BR>");

print("using single quotes :- \n");

print($row['townName']);

print("<BR>");

print("using no quotes :- \n");

print($row[townName]);

print("<BR>");

print("using printf :- \n");

printf("%s\n",$row->townName);

print("<BR>");

?>

And this is what the output looks like:-

using element 0 :- leeds
using double quotes :-
using single quotes :-
using no quotes :-
using printf :-

So I'm no wiser reallly...

Can anyone try running this snippet on their own system and show
me what happens?

It's coded to point at an host which _ought_ to be able to
service a query.

--
John

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message GH 2001-01-22 02:36:09 Re: What's wrong with this? (Pt II)
Previous Message Chris 2001-01-22 00:10:40 Re: What's wrong with this?