I was working on my privacy policy page and when I loaded it to test it, I got a fatal error my database file which I didn't touch.
Fatal error: Cannot redeclare tep_db_connect() in /var/www/html/catalog/includes/functions/database.php on line 13
Here is line 13 and a few that were below it.
*/
function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
global $$link;
if (USE_PCONNECT == 'true') {
$$link = mysql_pconnect($server, $username, $password);
} else {
$$link = mysql_connect($server, $username, $password);
}
if ($$link) mysql_select_db($database);
return $$link;
}
Can anyone see what is causing this error?
Thanks
Latest News: (loading..)
Fatal Error that appeared out of nowhere
Started by cjaccessories, Oct 23 2003, 12:09
4 replies to this topic
#1
Posted 23 October 2003, 12:09
#2
Posted 23 October 2003, 12:32
I suspect this has got something to do with including application_top.php to your new page. Make sure that you do this on line 1 of your new page, if you don't you will get these errors. The other possibility is that you are including application_top.php twice on your page.
I believe that's it.
EDIT: I meant of course the <?php tag on line 1, the include on line 2 and ?> on line 3.
I believe that's it.
EDIT: I meant of course the <?php tag on line 1, the include on line 2 and ?> on line 3.
Edited by WillemB, 23 October 2003, 12:33.
"Always the same with men, isn’t it? Looks like a starter handle, works like an off-switch."
- Coupling (BBC Comedy)
- Coupling (BBC Comedy)
#3
Posted 23 October 2003, 13:09
Quote
I suspect this has got something to do with including application_top.php to your new page. Make sure that you do this on line 1 of your new page, if you don't you will get these errors. The other possibility is that you are including application_top.php twice on your page.
I just checked and application_top.php is at the top under the <?php and is only listed once.
I even tried changing back to the old privacy page which worked and it still gave me the Fatal Error.
Any other ideas?
Edited by cjaccessories, 23 October 2003, 13:10.
#4
Posted 24 October 2003, 10:37
Whatever it is, there is nothing wrong with database.php, the code is what it should be.
Are you saying your old privacy page now gives you the same error? If that is the case, then your privacy page is not at fault either. Unless it is the only page that gives you errors, reply to this message with the entire contents of your file if that's the case.
Have you installed any new infoboxes or altered them, perhaps in connection with new contributions? Do they require/include application_top or database.php? As this get's all added to one HTML page in the end, this could also cause the error.
All I know it's a nasty little bug which puts you on the wrong foot, but spotting the problem shouldn't be too hard.
Are you saying your old privacy page now gives you the same error? If that is the case, then your privacy page is not at fault either. Unless it is the only page that gives you errors, reply to this message with the entire contents of your file if that's the case.
Have you installed any new infoboxes or altered them, perhaps in connection with new contributions? Do they require/include application_top or database.php? As this get's all added to one HTML page in the end, this could also cause the error.
All I know it's a nasty little bug which puts you on the wrong foot, but spotting the problem shouldn't be too hard.
"Always the same with men, isn’t it? Looks like a starter handle, works like an off-switch."
- Coupling (BBC Comedy)
- Coupling (BBC Comedy)
#5
Posted 24 October 2003, 18:28
This is most often caused by uploading a catalog page into the languages directory. Note: language directory files are made up of defines. If you find one that has require("includes/application_top.php"); in it, then it is misplaced.
What the error says is that includes/functions/database.php is being included twice.
Hth,
Matt
What the error says is that includes/functions/database.php is being included twice.
Hth,
Matt














