error connect mysqli

Questionserror connect mysqli
agustin asked 10 years ago

Hello good, I bought your http://www.shuttlelux.es code for the site and have the following error, please would need to fix it ..

Error

( ! ) Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:wampwwwxxxxcompradodemoseditingindex.php on line 14

My config.php

<?php
// PHP Grid database connection settings
define("PHPGRID_DBTYPE","Mysqli"); // or mysqli
define("PHPGRID_DBHOST","localhost");
define("PHPGRID_DBUSER","pepe");
define("PHPGRID_DBPASS","");
define("PHPGRID_DBNAME","griddemo");

// Automatically make db connection inside lib
define("PHPGRID_AUTOCONNECT",0);

// Basepath for lib
define("PHPGRID_LIBPATH",dirname(__FILE__).DIRECTORY_SEPARATOR."lib".DIRECTORY_SEPARATOR);

?>

2 Answers
Abu Ghufran answered 10 years ago

Please change Mysqli to mysqli (small m)

Abu Ghufran answered 10 years ago

also set
define("PHPGRID_AUTOCONNECT",1);

If you need custom connection without config file, 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);

Your Answer

10 + 17 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?