What's wrong with this? (Pt II)

Поиск
Список
Период
Сортировка
От John Poltorak
Тема What's wrong with this? (Pt II)
Дата
Msg-id 20010122013116.X85@eyup.org
обсуждение исходный текст
Ответы Re: What's wrong with this? (Pt II)  (GH <grasshacker@over-yonder.net>)
Список 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







В списке pgsql-novice по дате отправления:

Предыдущее
От: Chris
Дата:
Сообщение: Re: What's wrong with this?
Следующее
От: GH
Дата:
Сообщение: Re: What's wrong with this? (Pt II)