garrensilverwing
New Member
- Messages
- 148
- Reaction score
- 0
- Points
- 0
Ok I have a new php problem. I read a tutorial on connected to a database with php but I am having some problems. I get this error message when I try to run the script
Fatal error: Class 'DB' not found in /home/frostbit/public_html/php/protected/db_connect.php on line 12
idk what is wrong with it also how do i make a file protected so only I can use it?
Fatal error: Class 'DB' not found in /home/frostbit/public_html/php/protected/db_connect.php on line 12
idk what is wrong with it also how do i make a file protected so only I can use it?
Code:
<?php
$db_engine = 'mysql';
$db_user = 'admin';
$db_pass = '**';
$db_host = 'localhost';
$db_name = '**';
$datasource = $db_engine.'://'.
$db_user.':'.
[EMAIL="$db_pass.'@'"]$db_pass.'@'[/EMAIL].
$db_host.'/'.
$db_name;
[COLOR=black][I][COLOR=darkred] $db_object = DB::connect($datasource, TRUE);[/COLOR]
[/I][/COLOR] if(DB::isError($db_object)) {die($db_object->getMessage());}
$db_object->setFetchMode(DB_FETCHMODE_ASSOC);
include('check_login.php');
?>