Hi Abu, I am having to move my sites hosting to another provider who run php7, as I understand this doesn’t work with mysql code. I have the latest version of phpgrid but am having lots of issues when trying to upgrade my old phpgrid version. Can you tell me the files I should be replacing to move from old to new?
Simply override `lib/inc` & `lib/js` from latest build to the phpgrid folder in previous implementations.
Thank you, I tried that but throws errors everywhere. I notice in my old version the connection code is different, maybe thats it?
//old version
// include db config
include_once(“../config.php”);
// set up DB
mysql_connect(PHPGRID_DBHOST, PHPGRID_DBUSER, PHPGRID_DBPASS);
mysql_select_db(PHPGRID_DBNAME);
//new version
// include db config
include_once(“../../config.php”);
// include and create object
include(PHPGRID_LIBPATH.”inc/jqgrid_dist.php”);
// Database config file to be passed in phpgrid constructor
$db_conf = array(
“type” => PHPGRID_DBTYPE,
“server” => PHPGRID_DBHOST,
“user” => PHPGRID_DBUSER,
“password” => PHPGRID_DBPASS,
“database” => PHPGRID_DBNAME
);
Is the latest version the best to use?
PHP7 does not support mysql_* functions and removed them from php.
So you need to remove them from code and change it with new $db_conf setting.
Also make sure you set PHPGRID_DBTYPE to “mysqli” in ../../config.php file. (i added after mysql – mysqli)