Re: [GENERAL] PHP and Postgresql 6.5.1

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

Re: [GENERAL] PHP and Postgresql 6.5.1

От:
ghoffman@ucsd.edu (Gary Hoffman)
Дата:
Eric,
I've got my PHP running fine with PostGreSQL inthe past couple of weeks.
Here is a page that pulls out current members from my club roster and
displays some directory information in a table. I'm kinda proud of the
recursive (ir is it re-iterative?) sections. (Page edited to delete
impertinent identifying data.)
Don't forget to grant the Apache server (user www) select access to your
database or explicitly log in with a valid PostGreSQL user name.
Cheers,
Gary
----------------


CGSSD Member Directory


Member Directory

CGSSD membership information is current as of June 1999. This directory is for the non-commercial use of its members only. Any other use is prohibited.

Please wait for directory to load.
"; pg_close($conn); exit; } $rows = pg_NumRows($result); echo "$rows members in directory!\n"; # the non-breaking space is the best way I could find to control column widths echo "

\n"; echo "

\n"; for ($j=0; $j < $rows; $j++) { $member = pg_result($result, $j, 0) . ", " . pg_result($result, $j, 1); echo "

\n"; if (!pg_result($result, $j, 2) or !pg_result($result, $j, 3) or !pg_result($result, $j, 4)) { echo ""; } else { echo "\n"; } if (!pg_result($result, $j, 5)) { echo ""; } else { echo "\n"; } if (!pg_result($result, $j, 6)) { echo ""; } else { echo "\n"; } if (!pg_result($result, $j, 7)) { echo ""; } else { echo "\n"; } } echo "

                     Name                  &n bsp; Phone                Program                E-Mail AddressWeb Page
" . $member . " " . pg_result($result, $j, 2) . "-" . pg_result($result, $j, 3) ."-" . pg_result($result, $j, 4) ." " . pg_result($result, $j, 5) . " " . pg_result($result, $j, 6) ." " . pg_result($result, $j, 7) ."
"; ?> --------------------- ehb@one.net writes: >I downloaded and compiled the most recent version of PHP and Apache. >The PHP module functions properly when parsing commands such as >echo and variable declarations. However when I submit a query through >pg_exec and try to display the results using pg_Fetch_Array, I get >"Document >Contains No Data." I followed the instructions provided by PHP to test >for >segmentation fault and have come to the conclusion that when >PHP attempts >to post the query to the database, it blows up in segmentation fault. > >Does PHP work with Postgresql 6.5.1 at this time? > >Please reply to this list as well as my personal email account as soon >as possible. > >Thank you! > >Eric Buschelmann >Systems Analyst >ehb@one.net ************************************************************************** * Gary B. Hoffman, Computing Services Manager e-mail: ghoffman@ucsd.edu * * Graduate School of International Relations and Pacific Studies (IR/PS) * * University of California, San Diego (UCSD) voice: (858) 534-1989 * * 9500 Gilman Dr., La Jolla, CA 92093-0519 USA fax: (858) 534-3939 * **************************************************************************
FAQ