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 DirectoryMember 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 "
| Name &n bsp; | \n"; echo "Phone | Program | E-Mail Address | Web Page | ||||
|---|---|---|---|---|---|---|---|---|
| " . $member . " | \n"; if (!pg_result($result, $j, 2) or !pg_result($result, $j, 3) or !pg_result($result, $j, 4)) { echo ""; } else { echo " | " . pg_result($result, $j, 2) . "-" . pg_result($result, $j, 3) ."-" . pg_result($result, $j, 4) ." | \n"; } if (!pg_result($result, $j, 5)) { echo ""; } else { echo " | " . pg_result($result, $j, 5) . " | \n"; } if (!pg_result($result, $j, 6)) { echo ""; } else { echo " | " . pg_result($result, $j, 6) ." | \n"; } if (!pg_result($result, $j, 7)) { echo ""; } else { echo " | " . pg_result($result, $j, 7) ." | \n"; } } echo "