|
Posted by Erwin Moller on 03/23/07 15:20
dino d. wrote:
> hi everyone-
>
> if i have a simple question- if i open a database connection in one
> snippet of php, can i use it in a subsequent snippet in the same php
> file:
>
>
> <html>
> <head>
> </head>
> <body>
> ...
> <?php
>
> //open database here
>
> ?>
>
> //more html
>
> <?php
> //now use open database
>
> ?>
>
>
> i thought this should work but i'm getting errors. thanks for any
> help.
>
> dino
Hi,
Should work.
If you didn't close the connection, it is still available later in the SAME
script.
When PHP reaches the end of the script and stops, it automagically closes
the connection for you.
You must have some other issue going on in your script.
Maybe it helps if you post a real example, so we can see what you are really
doing.
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|