What's wrong with this?

Поиск
Список
Период
Сортировка
Искать

What's wrong with this?

От:
John Poltorak <jp@eyup.org>
Дата:

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:-



pg_test





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

Re: What's wrong with this?

От:
Chris <csmith@squiz.net>
Дата:

>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:-
>
>"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 - 
print($row[townName]);
or try single quotes - print($row['townName']);
its not a cross-platform thing, its a php syntax thing.

HTH

------------------------
Chris Smith
http://www.squiz.net

FAQ