Another way of doing this, is including a file at the beginning of each
script:

Example:

<?php
  # Include the file containing general variables/constants/funstions
  require ("general.inc");

  # Open a connection to MySQL using variables from general.inc
  $link = mysql_connect ($host, $username, $password);
?>

Regards,
-Bjarte-

> -----Original Message-----
> From: markus|lervik [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 04, 2002 12:40 PM
> To: Berlina
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Sending variables between PHP pages
>
>
> On Friday 04 January 2002 13:15, you wrote:
> > Hi users,
> >
> > how can I send a connection database variable, from one PHP
> page to other
> > PHP page, and maintance the database connection open during both pages?
> >
> > Thanks
>
> This is exactly what I've been fighting with for quite some time.
> Actually, what I did was, session_register username and password and
> the required variables and reconnect to the db when needed. Not quite the
> most elegant way of solving the problem, but it works...
> If anyone has got a better way of doing it, I'd be more than happy to hear
> about it.
>
> Cheers,
> Markus
>
> --
> Markus Lervik
> Linux-administrator with a kungfoo grip
> Vaasa City Library - Regional Library
> [EMAIL PROTECTED]
> +358-6-325 3589 / +358-40-832 6709
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to