(1046 No database selected )
(1046 No database selected )
zezooooo
Posts: 12Questions: 1Answers: 0
i cann't connect to database and (I work with mysql only)
This question has accepted answers - jump to:
This discussion has been closed.
Answers
I need help as quick as possible
Hi @zezooooo ,
Have you defined the database properties in the your
config.php
file? See this page here, it talks over that. Also, this thread may also help,Cheers,
Colin
thank you for repling
but it gives my errro (An SQL error occurred: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'fac_sys.fac_sys' doesn't exist","data":[],"ipOpts":[],"cancelled":[])
and the config.php file is
<?php if (!defined('DATATABLES')) exit(); // Ensure being used in DataTables env.
// Enable error reporting for debugging (remove for production)
error_reporting(E_ALL);
ini_set('display_errors', '1');
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Database user / pass
*/
$sql_details = array(
"type" => "Mysql", // Database type: "Mysql", "Postgres", "Sqlserver", "Sqlite" or "Oracle"
"user" => "root", // Database user name
"pass" => "", // Database password
"host" => "localhost", // Database host
"port" => "", // Database connection port (can be left empty for default)
"db" => "fac_sys", // Database name
"dsn" => "charset=utf8mb4", // PHP DSN extra information. Set as
charset=utf8mb4
if you are using MySQL"pdoAttr" => array() // PHP PDO attributes array. See the PHP documentation for all options
);
// This is included for the development and deploy environment used on the DataTables
// server. You can delete this block - it just includes my own user/pass without making
// them public!
if ( is_file($_SERVER['DOCUMENT_ROOT']."/datatables/pdo.php") ) {
include( $_SERVER['DOCUMENT_ROOT']."/datatables/pdo.php" );
}
// /End development include
the alert error is (1146 Table 'fac_sys.datatables_demo' doesn't exist)
how can i fix that
sorry it's the first time for using datatable
it's so awesome
and your support is excellent.
Hi @zezooooo ,
datatables_demo
is one of the example tables - in the first link I posted above, where you configure the database connection properties, there's a section called "Examples SQL". The SQL needed to create the sample tables for each database platform is in that section.It does seem like you've skipped a few steps. I would strongly suggest going back and ensuring each of the those steps have been completed - i.e. you need a database, with data, and notified Editor what the connection properties are, webserver installed, etc., before you can use it.
fac_sys.fac_sys
isn't one of ours, so I suspect it's your PHP script asking for it.Cheers,
Colin
Hi @colin
my database has data and word in another files
my problem is in edit the example bootstrap 3
and the connection to my database(fac_sys)
I want to know what scripts should i edit
I want to reply at 11 am to can modify the error
thanks
Your connection properties look unusual:
I wouldn't expect that - normally you have a database user. Can you attach to the DB with the command-line
mysql
program with those login credentials?not this .
my database username is root
and without password
and the file connected with table (datatable_demo)
and i edited it to (students) in my server script
i work on bootstrap 3 example
https://editor.datatables.net/examples/styling/bootstrap.html
I wait too much
Let's circle around to make sure I understand. You want to run the Editor Bootstrap 3 demo in a database called
fac_sys
? You have imported our demo SQL file, and renameddatatable_demo
to bestudents
? Have you also edited the PHP file with theEditor
PHP code to match that, as I don't seestudents
mentioned anywhere else above.I'm a little confused I'm afraid, so if you could clarify these points, that would be great.
Allan