I recently updated my wampserver 2.0 to wampserver 2.5.
And while i am running the php smarty code i am getting this error.
"Fatal error: Class 'DB' not found in
C:\wamp\www\livehrm.new\product\common.php on line 63"
I think it might be a pear issue of old wampserver.
Please help me
//session_start();
require_once 'DB.php';
$dbHost = $dbconfig['db_hostname'];
$dsn1[0] = array('type'=>'DB', 'dsnstuff'=>"mysql://$dbUser:$dbPassword@localhost/$dbName"); $dbdsn = "mysql://$dbUser:$dbPassword@$dbHost/$dbName";
$db = DB::connect($dbdsn);
if (DB::isError($db)) {
die ($db->getMessage());
}
?>
Its not the prefered solution, but this should get you working again.
I strongly recommend that you do in fact convert your code from using the mysql_* extension ot use either the mysqli_* or PDO instead as eventually this approach will not work as the developers of PHP will actually no longer provide the mysql_* extension.
But you can remove the warning messages by changing your php.ini configuration like this :-
Edit
php.ini
Find this line
and change it to
Or you can just add this PHP code at the top of your
db.php
script if you dont have access to your php.ini fileIf you are using Virtual Hosts you can actually add this to the specific VH for the site that is still using the old
mysql_*
extension therefore not affecting other site you may be developing/maintainingUnfortunately in a VH definition you have to use an integer value.