PHP+ postgresql help?
| From: | Smileyq | Date: | Tue, 21 Aug 2001 02:53:03 +0000 |
| Subject: | PHP+ postgresql help? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-11579@lists.php.net to get a copy of this message | ||
Hey I'm new to php and using databases. I've setup a postgres server and have already populated the database. I'm able to connect the the server just fine with php my problem is showing the results. Can somebody show me a easy to understand example. For example. I've got a address book database setup. I want to be able to search for first names. I'm using
$conn = pg_connect ("host=localhost user=username password=password bname=dbname");
I then have a sql statement setup as such
$sql = "SELECT * FROM database where lower('$name%') order by last;";
I then execute the sql statement
pg_Exec ($conn, $sql);
Now I want to be able to diplay the results on a page no tables or forms just a simple output I'll work on layout later. I've trying to do so using. pg_result. If anybody could help me I would greatly appreciate it. Thanks guys.
-Smileyq