Not answered Help Needed: Persistent "Call to a member function prepare() on null" Error with Metin2 CMS Panel

Member
Aug
Threads
1
23
0
1

AD: Mt2009 - Mobile & PC - 30 January 2026 CHECK THE PRESENTATION!

I'm new to server management and setting up systems for Metin2, and I've been running into a persistent issue when trying to set up a web panel using a CMS template. Specifically, I'm encountering the following error:


Fatal error: Uncaught Error: Call to a member function prepare() on null in /usr/local/www/apache24/data/include/classes/news.php:115 Stack trace: #0 /usr/local/www/apache24/data/pages/news.php(53): paginate->dataview('SELECT * FROM n...', 'Are you sure?', 0, 9, 'http://ip...', 'Read more') #1 /usr/local/www/apache24/data/index.php(249): include('/usr/local/www/...') #2 {main} thrown in /usr/local/www/apache24/data/include/classes/news.php on line 115

Here’s the relevant part of my news.php file:

class paginate { private $db; public function __construct() { $database = new Database(); $this->db = $database->dbConnection("", "", "", "", "yes"); } // Other functions... }

I have configured the database connection in config.php, where I've defined the settings for the game's database. However, I'm not sure if I need to create any additional databases specifically for the CMS, or if the existing game database is sufficient.

Could someone clarify if a separate database is needed for the CMS, and if so, what additional steps are required? Also, any insights on why the $db object might be null would be greatly appreciated.

Thanks in advance!
 
Metin2Hub Bot
M2Hub Bot
Feb
Threads
66
2,381
2
1,309
113
I'm new to server management and setting up systems for Metin2, and I've been running into a persistent issue when trying to set up a web panel using a CMS template. Specifically, I'm encountering the following error:


Fatal error: Uncaught Error: Call to a member function prepare() on null in /usr/local/www/apache24/data/include/classes/news.php:115 Stack trace: #0 /usr/local/www/apache24/data/pages/news.php(53): paginate->dataview('SELECT * FROM n...', 'Are you sure?', 0, 9, 'http://ip...', 'Read more') #1 /usr/local/www/apache24/data/index.php(249): include('/usr/local/www/...') #2 {main} thrown in /usr/local/www/apache24/data/include/classes/news.php on line 115

Here’s the relevant part of my news.php file:

class paginate { private $db; public function __construct() { $database = new Database(); $this->db = $database->dbConnection("", "", "", "", "yes"); } // Other functions... }

I have configured the database connection in config.php, where I've defined the settings for the game's database. However, I'm not sure if I need to create any additional databases specifically for the CMS, or if the existing game database is sufficient.

Could someone clarify if a separate database is needed for the CMS, and if so, what additional steps are required? Also, any insights on why the $db object might be null would be greatly appreciated.

Thanks in advance!

Hello dear user,

Your post will be under surveillance by bots for the next few hours.

Forum description : Metin2 private server, Metin2 download, Metin2 support, Metin2 Forum, Metin2 Pvp Servers, Errors, Bugs, Requests, Metin2 Pvp Forum, Everything About Metin2.
 
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock