w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
how to solve errors in an sql query that returns an error saying no database chosen for select statement and it suggest select default DB?

Take a look at the documentation for the database software you are using.

For example, if you're running MySQL run: USE where is the name of the database, if done via CLI. If you're doing this programmatically, consult the documentation used there. For example, using mysqli in PHP

Assuming an active connection:

mysqli_select_db(<databaseName>);

again where database name is a string of the name of the database. You call this before making any queries.

Other RDBMS systems use other methods, for example, on command line DB2 you would issue

CONNECT TO <databaseName> USER <userName> USING
<password>




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.