Skip to main content
Melhora a leitura da mensagem de erro
Fonte Link
Gabe
  • 2,5mil
  • 2
  • 25
  • 40

Ao tentar conectar o phpactiverecord ao banco de dados no XAMPP phpmyadmin por meio deste código:

<?php

require_once 'php-activerecord/ActiveRecord.php';

$cfg = ActiveRecord\Config::instance ();
$cfg->set_model_directory ( 'model' );
$cfg->set_connections ( array ('development' => 'mysql://root@localhost/phpmyadmin/dbaqua') );

Recebe-se a seguinte mensagem de erro:

Fatal error:  
Uncaught exception 'ActiveRecord\DatabaseException'  
with message 
 'exception "exception 'PDOException'
   with message 'SQLSTATE[HY000] [1049] Unknown database 'phpmyadmin/dbaqua'' dbaqua'"
in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php:202 Stack
>Stack trace: #0
>0 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(202): PDO->__construct('mysql:host=loca...', 'root', NULL, Array) #1
>1 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(99): ActiveRecord\Connection->__construct(Object(stdClass)) #2
>2 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('development') #3
>3 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(83): ActiveRecord\ConnectionManager::get_connection(NULL) #4
>4 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(61): ActiveRecord\Table->__construct('UsuarioModel') #5
>5 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\M in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php on line 204

Como isso pode ser solucionado? Desde já obrigada.

UsuarioModel:

<?php

require_once 'settings/config.php';

class UsuarioModel extends ActiveRecord\Model {
    static $table_name = 'tdusuario';
}

Ao tentar conectar o phpactiverecord ao banco de dados no XAMPP phpmyadmin por meio deste código:

<?php

require_once 'php-activerecord/ActiveRecord.php';

$cfg = ActiveRecord\Config::instance ();
$cfg->set_model_directory ( 'model' );
$cfg->set_connections ( array ('development' => 'mysql://root@localhost/phpmyadmin/dbaqua') );

Recebe-se a seguinte mensagem de erro:

Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'exception 'PDOException' with message 'SQLSTATE[HY000] [1049] Unknown database 'phpmyadmin/dbaqua'' in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php:202 Stack trace: #0 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(202): PDO->__construct('mysql:host=loca...', 'root', NULL, Array) #1 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(99): ActiveRecord\Connection->__construct(Object(stdClass)) #2 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('development') #3 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(83): ActiveRecord\ConnectionManager::get_connection(NULL) #4 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(61): ActiveRecord\Table->__construct('UsuarioModel') #5 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\M in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php on line 204

Como isso pode ser solucionado? Desde já obrigada.

UsuarioModel:

<?php

require_once 'settings/config.php';

class UsuarioModel extends ActiveRecord\Model {
    static $table_name = 'tdusuario';
}

Ao tentar conectar o phpactiverecord ao banco de dados no XAMPP phpmyadmin por meio deste código:

<?php

require_once 'php-activerecord/ActiveRecord.php';

$cfg = ActiveRecord\Config::instance ();
$cfg->set_model_directory ( 'model' );
$cfg->set_connections ( array ('development' => 'mysql://root@localhost/phpmyadmin/dbaqua') );

Recebe-se a seguinte mensagem de erro:

Fatal error: 
Uncaught exception 'ActiveRecord\DatabaseException' 
with message 
  "exception 'PDOException'
   with message 'SQLSTATE[HY000] [1049] Unknown database 'phpmyadmin/dbaqua'"
in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php:202
>Stack trace:
>0 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(202): PDO->__construct('mysql:host=loca...', 'root', NULL, Array)
>1 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(99): ActiveRecord\Connection->__construct(Object(stdClass))
>2 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('development')
>3 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(83): ActiveRecord\ConnectionManager::get_connection(NULL)
>4 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(61): ActiveRecord\Table->__construct('UsuarioModel')
>5 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\M in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php on line 204

Como isso pode ser solucionado? Desde já obrigada.

UsuarioModel:

<?php

require_once 'settings/config.php';

class UsuarioModel extends ActiveRecord\Model {
    static $table_name = 'tdusuario';
}

Ao tentar conectar o phpactiverecord ao banco de dados no xamppXAMPP phpmyadmin por meio deste código:

set_model_directory ( 'model' );
<?php

require_once 'php-activerecord/ActiveRecord.php';

$cfg = ActiveRecord\Config::instance ();
$cfg->set_model_directory ( 'model' );
$cfg->set_connections ( array ('development' => 'mysql://root@localhost/phpmyadmin/dbaqua') );
$cfg->set_connections ( array ('development' => 'mysql://root@localhost/phpmyadmin/dbaqua') ); Recebe-se a seguinte mensagem de erro: Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'exception 'PDOException' with message 'SQLSTATE[HY000] [1049] Unknown database 'phpmyadmin/dbaqua'' in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php:202 Stack trace: #0 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(202): PDO->__construct('mysql:host=loca...', 'root', NULL, Array) #1 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(99): ActiveRecord\Connection->__construct(Object(stdClass)) #2 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('development') #3 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(83): ActiveRecord\ConnectionManager::get_connection(NULL) #4 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(61): ActiveRecord\Table->__construct('UsuarioModel') #5 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\M in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php on line 204 Como isso pode ser solucionado? Desde já obrigada. *UsuarioModel:

Recebe-se a seguinte mensagem de erro:

Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'exception 'PDOException' with message 'SQLSTATE[HY000] [1049] Unknown database 'phpmyadmin/dbaqua'' in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php:202 Stack trace: #0 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(202): PDO->__construct('mysql:host=loca...', 'root', NULL, Array) #1 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(99): ActiveRecord\Connection->__construct(Object(stdClass)) #2 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('development') #3 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(83): ActiveRecord\ConnectionManager::get_connection(NULL) #4 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(61): ActiveRecord\Table->__construct('UsuarioModel') #5 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\M in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php on line 204

Como isso pode ser solucionado? Desde já obrigada.

UsuarioModel:

<?php

require_once 'settings/config.php';

class UsuarioModel extends ActiveRecord\Model {
    static $table_name = 'tdusuario';
}

Ao tentar conectar o phpactiverecord ao banco de dados no xampp phpmyadmin por meio deste código:

set_model_directory ( 'model' ); $cfg->set_connections ( array ('development' => 'mysql://root@localhost/phpmyadmin/dbaqua') ); Recebe-se a seguinte mensagem de erro: Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'exception 'PDOException' with message 'SQLSTATE[HY000] [1049] Unknown database 'phpmyadmin/dbaqua'' in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php:202 Stack trace: #0 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(202): PDO->__construct('mysql:host=loca...', 'root', NULL, Array) #1 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(99): ActiveRecord\Connection->__construct(Object(stdClass)) #2 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('development') #3 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(83): ActiveRecord\ConnectionManager::get_connection(NULL) #4 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(61): ActiveRecord\Table->__construct('UsuarioModel') #5 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\M in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php on line 204 Como isso pode ser solucionado? Desde já obrigada. *UsuarioModel:

Ao tentar conectar o phpactiverecord ao banco de dados no XAMPP phpmyadmin por meio deste código:

<?php

require_once 'php-activerecord/ActiveRecord.php';

$cfg = ActiveRecord\Config::instance ();
$cfg->set_model_directory ( 'model' );
$cfg->set_connections ( array ('development' => 'mysql://root@localhost/phpmyadmin/dbaqua') );

Recebe-se a seguinte mensagem de erro:

Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'exception 'PDOException' with message 'SQLSTATE[HY000] [1049] Unknown database 'phpmyadmin/dbaqua'' in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php:202 Stack trace: #0 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(202): PDO->__construct('mysql:host=loca...', 'root', NULL, Array) #1 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(99): ActiveRecord\Connection->__construct(Object(stdClass)) #2 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('development') #3 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(83): ActiveRecord\ConnectionManager::get_connection(NULL) #4 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(61): ActiveRecord\Table->__construct('UsuarioModel') #5 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\M in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php on line 204

Como isso pode ser solucionado? Desde já obrigada.

UsuarioModel:

<?php

require_once 'settings/config.php';

class UsuarioModel extends ActiveRecord\Model {
    static $table_name = 'tdusuario';
}
Fonte Link

Erro ao conectar PHP ActiveRecord com XAMPP phpmyadmin

Ao tentar conectar o phpactiverecord ao banco de dados no xampp phpmyadmin por meio deste código:

set_model_directory ( 'model' ); $cfg->set_connections ( array ('development' => 'mysql://root@localhost/phpmyadmin/dbaqua') ); Recebe-se a seguinte mensagem de erro: Fatal error: Uncaught exception 'ActiveRecord\DatabaseException' with message 'exception 'PDOException' with message 'SQLSTATE[HY000] [1049] Unknown database 'phpmyadmin/dbaqua'' in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php:202 Stack trace: #0 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(202): PDO->__construct('mysql:host=loca...', 'root', NULL, Array) #1 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php(99): ActiveRecord\Connection->__construct(Object(stdClass)) #2 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\ConnectionManager.php(33): ActiveRecord\Connection::instance('development') #3 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(83): ActiveRecord\ConnectionManager::get_connection(NULL) #4 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Table.php(61): ActiveRecord\Table->__construct('UsuarioModel') #5 C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\M in C:\xampp\htdocs\BancoAQUA\service\library\php-activerecord\lib\Connection.php on line 204 Como isso pode ser solucionado? Desde já obrigada. *UsuarioModel: