Re: What's wrong with this code?

From: Date: Mon, 26 Mar 2001 17:27:33 +0000
Subject: Re: What's wrong with this code?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7835@lists.php.net to get a copy of this message
In article <20010326153443.87365.qmail@web9503.mail.yahoo.com>, emusabasic@yahoo.com (Emir Musabasic) wrote: > I have user/password/host variables inside a config > file but for some reason when I include this into a > php page when I test it, I get: > > Fatal error: Cannot redeclare db_connect() in > /www/affiliate/include/functions.inc on line 7. > > Am I missing something because everything looks good > to me. Try using include_once() instead of include(). You're probably inadvertantly re-including the file. In general, except where you're deliberately making multiple includes of the same file, it's a good idea to get in the habit of using include_once() or require_once() to save yourself from surprises like this. -- CC

« previous php.db (#7835) next »