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

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

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



environment: laravel

data backend: mysql

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);

in application code:

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


5 Answers
Abu Ghufran Staff answered 4 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(
“server” => PHPGRID_DBHOST,
“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 4 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 4 years ago



DB_DATABASE is defined in laravel .env file

Abu answered 4 years ago

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

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.

Jim Poon answered 4 years ago

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


problem fixed now



Your Answer

4 + 7 =

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?