RE: [PHP] Persistent connection & many scripts ?
| From: | Picard, Cyril | Date: | Tue, 17 Apr 2001 14:28:05 +0000 |
| Subject: | RE: [PHP] Persistent connection & many scripts ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-48971@lists.php.net to get a copy of this message | ||
Yes... I'm not familiar with sessions. This should be like this ? :
In connect.php :
<?php
session_start();
$connect = pg_pConnect("blablabla");
session_register("connect");
<A HREF="query.php?<?=SID"?>clique ici</?>
?>
In query.php
<?php
session_start();
$connect = $HTTP_SESSION_VARS["connect"];
$result = pg_Exec($connect, "SELECT * FROM xyz");
?>
> -----Message d'origine-----
> De: Plutarck [SMTP:aemuli@spamclause-yahoo.com]
> Date: mardi 17 avril 2001 16:03
> À: php-general@lists.php.net
> Objet: Re: [PHP] Persistent connection & many scripts ?
>
> Ideally you could use pconnect, then save the connection ID into a
> session.
> Then just try and use the connection like that.
>
> That _should_ work. But you may just want to use pconnect and not bother
> with the rest...that might be just as good as what you are trying to do.
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
> ""Picard, Cyril"" <cyril.picard@eads-dsn.com> wrote in message
>
> news:B5CDCF382265D311BF33009027A8FE9401E6F3B7@pmrmsg.edsn.com...
> > Hi all
> > I use PHP to query a PostgreSQL database.
> > Today I know how to query the database with a PHP script, but I have to
> > establish a connection to the database in each script.
> >
> > Is there a way to get the following :
> > connect.php : a script where the user enters its login and password, and
> > connect to the DB by the submit button (submit button which action url
> is
> > query.php).
> > query.php : a script that performs a query using the connection from
> > connect.php
> >
> > I know that I could send the login/password to the query.php to
> establish
> > the connection ; but it is not what I would like (sometimes - often -
> the
> > connection time is bigger than the query time itself !)
> > Thanks for your help !
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net