{"id":1540,"date":"2022-08-30T15:17:23","date_gmt":"2022-08-30T15:17:23","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/27\/database-doesnt-connect-in-kohana-3-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:17:23","modified_gmt":"2022-08-30T15:17:23","slug":"database-doesnt-connect-in-kohana-3-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/database-doesnt-connect-in-kohana-3-collection-of-common-programming-errors\/","title":{"rendered":"Database doesn&#39;t connect in Kohana 3-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m trying to connect to my database in Kohana 3 but it&#8217;s not connecting.<\/p>\n<p>This is the query I&#8217;m trying to run from one of my modules:<\/p>\n<pre><code>$results = DB::select()-&gt;from('users')-&gt;where('verified', '=', 0)-&gt;execute();\n<\/code><\/pre>\n<p>Here&#8217;s the dump of the error:<\/p>\n<pre><code>ErrorException [ Notice ]: Undefined property: Config_File::$default\nMODPATH\\database\\classes\\kohana\\database.php [67]\nif($config === NULL)\n{\n    \/\/ Load the configuration for this database\n    \/\/ echo \"<\/code><\/pre>\n<pre><code>\";\n    \/\/die(print_r(unserialize(Kohana::config('database'))));\n    $config = Kohana::config('database')-&gt;$name;\n}\n\nif(!isset($config['type']))\n{\n   throw new Kohana_Exception('Database type not defined in :name configuration',\n<\/code><\/pre>\n<pre>\n<br \/>I have the following config setup in application\/config\/database.php\n<\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-27 05:08:02. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to connect to my database in Kohana 3 but it&#8217;s not connecting. This is the query I&#8217;m trying to run from one of my modules: $results = DB::select()-&gt;from(&#8216;users&#8217;)-&gt;where(&#8216;verified&#8217;, &#8216;=&#8217;, 0)-&gt;execute(); Here&#8217;s the dump of the error: ErrorException [ Notice ]: Undefined property: Config_File::$default MODPATH\\database\\classes\\kohana\\database.php [67] if($config === NULL) { \/\/ Load the configuration [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1540","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1540"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1540\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}