Fatal error: Cannot redeclare...

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 13
Joined: Tue Jan 28, 2003 4:22 am

Mon Mar 24, 2003 1:03 pm

Hi, my main program lists an HTML table with certain records. This HTML table has a column that enables the user to delete records by clicking a special link.

This link points to a secondary .php code that deletes the record. Then, I added an include clause that points back to the main php program to show the updated and new real list.

My problem is that I get an error that says that I am declaring again a previously declared function, like:

"Fatal error: Cannot redeclare dbconnect() in c:\apache\htdocs........"

main.php ----> deleterec.php ----> main.php

Is there any different way to make the user delete records using the same HTML and link column to avoid this error ?

Thank you!

New php-forum User
New php-forum User
Posts: 10
Joined: Tue Mar 25, 2003 3:59 am
Location: bucharest-romania

Tue Mar 25, 2003 4:22 am

i use the folowing code for a connection to a database:


/* Connecting, selecting database */
$link = mysql_connect("localhost", "root", "") or die("Could not connect");
//echo "Connected successfully";
mysql_select_db("cltbooking") or die("Could not select database");


which is inserted in a file and for any file which use a database connection I just use:

include '../script/conexiuneclt.php';

between the <head> tags

.... a now problem received.

For your delete page i use the following steps:

1. open the delete page and show up the details regarding the record
2. after the click on a delete button the record is delete, the main page is refreshed and the curent window is closed.

please let me know if i succeded to help you

Post Reply