Always got a error popup window (actually not an error)

QuestionsAlways got a error popup window (actually not an error)
Jim Poon asked 5 years ago

actually, it is NOT an error. It is the content of the mysql result. I don’t know why.

 

errorhttps://imgur.com/a/fH8GW7X

environment: laravel

data backend: mysql

Error:
Couldn’t execute query. No database selected – SELECT count(*) as c FROM (SELECT * FROM T000115841008282474740 WHERE 1=1) pg_tmp

Checked from internal application log:

data connection OK

table EXISTS.

any hints about this?

 

in jqgrid.dist.php:

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
ini_set(“display_errors”,”off”);

in application code:

$g->con->debug = 0; // changed from 0 to 1

 

5 Answers
Abu Ghufran Staff answered 5 years ago

Error shows database connection issue: No database selected

Please confirm if you are passing correct database credentials to the constructor. e.g.

$db_conf = array(
“type” => PHPGRID_DBTYPE,
“server” => PHPGRID_DBHOST,
“user” => PHPGRID_DBUSER,
“password” => PHPGRID_DBPASS,
“database” => PHPGRID_DBNAME
);

$grid = new jqgrid($db_conf);

And these constants are defined before you call.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Jim Poon answered 5 years ago

I am using the following db_conf. is this ok?  $db_conf = array(
“type” => ‘mysqli’,
“server” => env(‘DB_HOST’),
“user” => env(‘DB_USERNAME’),
“password” => env(‘DB_PASSWORD’),
“database” => env(‘DB_DATABASE’),
‘wait_timeout’ => ‘1000’,
‘interactive_timeout’ => ‘1000’,
‘net_read_timeout’ => ‘1000’,
‘unix_socket’ => env(‘DB_SOCKET’, ”),
‘charset’ => ‘utf8mb4’,
‘collation’ => ‘utf8mb4_unicode_ci’,
‘prefix’ => ”,
‘strict’ => false,
‘engine’ => null,
);

Jim Poon answered 5 years ago

fyi.

 

DB_DATABASE is defined in laravel .env file

Abu answered 5 years ago

I am sending you a sample laravel controller that uses datagrid.

https://gist.github.com/57502cd08b90b90917d829ad91494761

Looks like env(…) data is not being fetched.

You can also try downloading laravel 5.5 complete code from here and compare with your copy.
https://www.gridphp.com/wp-content/uploads/laravel5.5.zip

Jim Poon answered 5 years ago

Yes. It is really an issue from old laravel 5.x in getting the env string.

 

problem fixed now

 

thx

Your Answer

18 + 5 =

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?