CodeIgniter Forums
Error in DB.php - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Error in DB.php (/showthread.php?tid=30578)

Pages: 1 2


Error in DB.php - El Forum - 05-19-2010

[eluser]Tamilmani[/eluser]
Hi,

I have recently download from codeigniter . I am getting error message in DB.php

Code:
Fatal error: Call to undefined function instantiate_class() in C:\wamp\www\project\database\DB.php on line 1

what is the problem? Any one tell me how to fix this issue?


Error in DB.php - El Forum - 05-19-2010

[eluser]johnwbaxter[/eluser]
This doesn't belong in this forum section as this is for bugs. Yours is a support type request.

Can you show me some of your code please? Then i can tell you where you are going wrong.

Cheers!


Error in DB.php - El Forum - 05-19-2010

[eluser]Tamilmani[/eluser]
Yes . Mistakenly i done this .


Error in DB.php - El Forum - 05-19-2010

[eluser]johnwbaxter[/eluser]
No problem, just letting you know in case you weren't aware!

Have you solved your problem then? Or do you need some help?


Error in DB.php - El Forum - 05-19-2010

[eluser]Tamilmani[/eluser]
No,

Still i have that issue .


Error in DB.php - El Forum - 05-19-2010

[eluser]johnwbaxter[/eluser]
Can you show me the code in your controller?


Error in DB.php - El Forum - 05-19-2010

[eluser]Tamilmani[/eluser]
This is not controller issue.This is database problem . I got error message DB.php.

Here my sample database.php code

Code:
$db['default']['hostname'] = "63.55.72.149";
$db['default']['username'] = "username";
$db['default']['password'] = "password";
$db['default']['database'] = "database";
$db['default']['dbdriver'] = "mssql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";



Error in DB.php - El Forum - 05-19-2010

[eluser]johnwbaxter[/eluser]
That's strange because line 1 is the line of code that sets the security for the file.

What if you try connecting to a mysql db? Same error?


Error in DB.php - El Forum - 05-19-2010

[eluser]Tamilmani[/eluser]
Now i have changed the code
Code:
$DB =& instantiate_class(new $driver($params)); to $DB =& new $driver($params);
in DB.php file.

Its loading fine . I don't get any error.


Error in DB.php - El Forum - 05-19-2010

[eluser]johnwbaxter[/eluser]
What version of PHP are you on?