PHP: cannot declare class because the name is already in use

You want to use include_once() or require_once(). The other option would be to create an additional file with all your class includes in the correct order so they don’t need to call includes themselves:

“classes.php”

include 'database.php';
include 'parent.php';
include 'child1.php';
include 'child2.php';

Then you just need:

require_once('classes.php');

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)