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
gaogier
Forum Contributor
Posts: 391 Joined: Wed Mar 02, 2005 1:02 pm
Location: Portsmouth, UK
Contact:
Post
by gaogier » Fri Apr 14, 2006 3:46 pm
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
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Apr 14, 2006 3:49 pm
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 » Fri Apr 14, 2006 3:50 pm
so, what do i do?
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Fri Apr 14, 2006 3:54 pm
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 » Fri Apr 14, 2006 4:04 pm
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 » Fri Apr 14, 2006 4:30 pm
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 » Fri Apr 14, 2006 7:32 pm
like?