Re: php/postgres display information...
| From: | Joe Conway | Date: | Tue, 08 May 2001 20:55:13 +0000 |
| Subject: | Re: php/postgres display information... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51981@lists.php.net to get a copy of this message | ||
> hey guys,
> alright, I am new to using php to interface with a database, right now I
> am trying to display just the primary keys for a table in my database, can
> someone point me in the right direction on how to use php to display this
> information?
Create a function to supply the info -- see:
http://www.brasileiro.net/postgres/cookbook/view-one-recipe.adp?recipe_id=36
Then call the function:
<?PHP
$conn = pg_connect("dbname=your_db_name user=your_user_name
password=your_password");
$sql = "select get_pk('your_table_name')";
$rs = pg_exec($conn,$sql);
. . .etc
Hope this helps,
Joe