php - Wampserver Upgrading issue -
i updated wampserver 2.0 wampserver 2.5.
and while running php smarty code getting error.
"fatal error: class 'db' not found in c:\wamp\www\livehrm.new\product\common.php on line 63"
i think might 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()); } ?>
mysql extension deprecated of php 5.5.0, , not recommended writing new code removed in future. instead, either mysqli or pdo_mysql extension should used. ref: http://php.net/manual/en/function.mysql-select-db.php
update db.php next code
<?php $con = mysqli_connect("localhost","root",""); $db="livehrm"; if (!$con) { die('could not connect: ' . mysqli_error($con)); } mysqli_select_db($con, $db) or die ("database connection error:\n" . mysqli_error($con)); ?>
there not class found in provided code of file db.php. update reply when send class code of db
php mysql wampserver smarty3
No comments:
Post a Comment