Just installed PHP Grid on a WAMP server.
However we are getting
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:wampwwwphpgriddemoseditingindex.php on line 14
Apache v2.4.9 – PHP v5.5.12 – MySQL v5.6.17
What do we need to do to get this working ?
Hello,
You need to change mysql -> mysqli in config.php.
It will take care of rest demos.
Refer faq:
Q) How to use mysqli extension?
Here is the config settings.
$db_conf = array();
$db_conf["type"] = "mysqli";
$db_conf["server"] = "localhost"; // or you mysql ip
$db_conf["user"] = "root"; // username
$db_conf["password"] = "test"; // password
$db_conf["database"] = "griddemo"; // database
// include and create object
$base_path = strstr(realpath("."),"demos",true)."lib/";
include($base_path."inc/jqgrid_dist.php");
$g = new jqgrid($db_conf);
After that, all calls will use mysqli extension.
For demos,
Comment these lines in index.php
// // set up DB
// mysql_connect(PHPGRID_DBHOST, PHPGRID_DBUSER, PHPGRID_DBPASS);
// mysql_select_db(PHPGRID_DBNAME);
In config.php
// Automatically make db connection inside lib, without pass $dbconf — set 1
define("PHPGRID_AUTOCONNECT",1);
// set mysqli
define("PHPGRID_DBTYPE","Mysqli");
These changes should run the demo.
Hi, we have an older Version of PHPGrid with this construction
define('DB_HOSTNAME','localhost'); // database host name
define('DB_USERNAME', 'root'); // database user name
define('DB_PASSWORD', 'lamop780'); // database password
define('DB_NAME', 'aggregated'); // database name
define('DB_TYPE', 'mysqli'); // database type
define('DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset
in conf.php
We cannot connct it to mysqli. What to do?
We do not have any such configuration, our product documentation is on this url.
Our product don't support this api and constant since v1.
Perhaps, you are searching for similar product from http://www.phpgrid.com vendor.
Hi, we have an older Version of PHPGrid with this construction
define('DB_HOSTNAME','localhost'); // database host name
define('DB_USERNAME', 'root'); // database user name
define('DB_PASSWORD', 'lamop780'); // database password
define('DB_NAME', 'aggregated'); // database name
define('DB_TYPE', 'mysqli'); // database type
define('DB_CHARSET','utf8'); // ex: utf8(for mysql),AL32UTF8 (for oracle), leave blank to use the default charset
in conf.php
We cannot connct it to mysqli. What to do?
The demo browser is based mysql_connect functions. So it may not run with PHP 5.6+
W're working on updating demo browser to remove the deprecated functions.
Library do support mysqli and working demo can be checked from this link:
Code: http://phpgrid.org/demo/demos/loading/db-layer-mysqli.phps
Live: http://phpgrid.org/demo/demos/loading/db-layer-mysqli.php
I'm having trouble making the connection with the Bank of oracle data, could send me an example of connection?
The last comment helped me. Though just to be specific, the index.php Abu is referring to is the one found here: phpgriddemosediting It is not the index.php found in the root phpgrid folder
Actually, while I no longer receive the error when I browse to index.php I do receive errors when I click on any of the links because it seems many of them have calls to mysql_connect(PHPGRID_DBHOST, PHPGRID_DBUSER, PHPGRID_DBPASS);
mysql_select_db(PHPGRID_DBNAME);
And commenting out these lines cause the demo to not show anything. So this did not fix my problem.