Re: [personal] HTML to access a database

From: Bruno LEVEQUE <bruno(dot)leveque(at)net6d(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Cc: papapep <papapep(at)gmx(dot)net>
Subject: Re: [personal] HTML to access a database
Date: 2003-10-20 12:11:56
Message-ID: 3F93D10C.3000208@net6d.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Here is an example of php and postgres
Sorry there is code before and after :

[...]
$conn=pg_connect("host=localhost user=USER dbname=DB");
if (!$conn) {
echo "An error occurs.<BR>";
exit;
}

$query="SET DATESTYLE TO PostgreSQL,European";
# execution of a query
pg_query($conn, $query);

$query="SELECT * from agenda where date = '" . $MaDate . "'";
$result = pg_query($conn, $query)

if (!$result) {
echo "An error occurs. - " . $cas . " + " . $UneDate .
" + " . $Donnees[0] . ":0:0<BR>";
exit;
}
foreach (pg_fetch_all($result) as $value)
{
$libDest = "Text " . $value[NAMEOFCOL1];
$libSrc = "TExt $value[NAMEOFCOL2]";
}

[...]

With this you take a minimum of knowledge of php/postgres

Bruno

papapep wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Evan Panagiotopoulos wrote:
> | I created a database with a table and I am interested to learn how to
> | access it from a web page. Since I am a novice I would like to see an
> | example or two of that.
>
> How about taking a look at the phppgadmin code? I think it should be
> helpfull for you.
>
> Josep Sànchez
> [papapep]
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQE/k74z2vx52x0kyz4RAkX6AJwLYsW8snkq/seV6e9nyoV7mc2CVgCfeELA
> E0OdH1PUDz1OA7eHEC1nJ+E=
> =9Bpa
> -----END PGP SIGNATURE-----
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruno LEVEQUE
System Engineer
SARL NET6D
bruno(dot)leveque(at)net6d(dot)com
http://www.net6d.com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Alexander Pucher 2003-10-20 16:01:20 Cross-classified table
Previous Message papapep 2003-10-20 10:51:32 Re: [personal] HTML to access a database