how do i fix?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

how do i fix?

Post by gaogier »

Fatal error: Cannot redeclare escape_data() (previously declared in /home/nlruneh/mysql_connect31.php:6) in /home/nlruneh/mysql_connect.php on line 12

how can i fix this?

ps, no code, as its just connecting to the databases and its got usernames and passwords in
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

both scripts referenced have the same function defined in them. You are not allowed to redeclare functions.
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

so, what do i do?
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

gaogier wrote:so, what do i do?
you are probably including two files that both include a file to that function. you may want to look into include_once or require_once
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

ok, we use require once

Code: Select all

require_once ('../mysql_connect.php');//connect to db
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

gaogier wrote:so, what do i do?
use a different naming convention?
gaogier
Forum Contributor
Posts: 391
Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:

Post by gaogier »

like?
Post Reply