Page 1 of 1

how do i fix?

Posted: Fri Apr 14, 2006 3:46 pm
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

Posted: Fri Apr 14, 2006 3:49 pm
by feyd
both scripts referenced have the same function defined in them. You are not allowed to redeclare functions.

Posted: Fri Apr 14, 2006 3:50 pm
by gaogier
so, what do i do?

Posted: Fri Apr 14, 2006 3:54 pm
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

Posted: Fri Apr 14, 2006 4:04 pm
by gaogier
ok, we use require once

Code: Select all

require_once ('../mysql_connect.php');//connect to db

Posted: Fri Apr 14, 2006 4:30 pm
by malcolmboston
gaogier wrote:so, what do i do?
use a different naming convention?

Posted: Fri Apr 14, 2006 7:32 pm
by gaogier
like?