PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 9th, 1999, 10:07 AM
lagc
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Dear friends

I'm starting with PHP, and I have any questions:

How interchange the values of global variables between different files of php's scripts?

By example
in file bdgeo.php3
$bd contains the link to an open data base
this file call to other file named b1.php3
in file b1.php3
$db is unknow!

I think that the connection to the database should make only one time, in first script. In other way, How I maintain active the database connection among the different pages?

Can somebody help me?

Thank you
Luis A. Gonzalez
BCN

Reply With Quote
  #2  
Old August 9th, 1999, 02:55 PM
jpenix
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Nope, you have to re-establish the database connection on the next page. In the background, PHP may be using a persistent connection, but that depends on configuration.

Easiest way to do this is make an include file that has the database connection command(s) and then 'require("<file>.inc"); at the top of each script that needs a database.

Then if anything ever changes (location of DB, name, etc), you only have to change the parameters once...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > scope of database conmection


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT