PHP Error: Fatal error: Cannot instantiate

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

PHP Error: Fatal error: Cannot instantiate

Post by amir »

I'm getting this error in some php code.. Any ideas?
Fatal error: Cannot instantiate non-existent class: object in /home/visitech/public_html/csi/Connections/csi.php on line 31

Line 31 is: $DB = new Object;
Here is the code:

Code: Select all

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
// TO DO:
// Enter correct values for your MySQL Database Connection!
switch($testserver) {
     case(1): // Production DB
          $hostname_csi = "localhost";
          $database_csi = "vtdata_csi";
          $username_csi = "vt_dba";
          $password_csi = "1234567890";
          break;
     case(2): // mullangi
          $hostname_csi = "localhost";
          $database_csi = "vtdata_csi";
          $username_csi = "vt_dba";
          $password_csi = "1234567890";
          break;
     default:
          $hostname_csi = "localhost";
          $database_csi = "vtdata_csi";
          $username_csi = "vt_dba";
          $password_csi = "1234567890";
}
/************************* END TO DO *************************/
$csi = mysql_pconnect($hostname_csi, $username_csi, $password_csi) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database_csi, $csi);
$CFG->secretword = 'zFdGCgxlkYXtUYfuXCFSg6Fiy9hKK0nvMcUC6HiMg5W1dGF6kDKtOhZg5RkLd9I';
$CFG->cookiename = 'vtcookie';
$DB = new Object;
$CFG->database_csi = $DB->database_csi = $database_csi;
$CFG->csi = $DB->csi = $csi;
?>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

PHP was unable to find a class named Object.

Maybe you're wanting a stdClass?
Post Reply