• 3 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeIgniter 4 Playground

#41
There was some database setting in the .env file that I copied into my project. I have removed this lines in .env
Code:
# database.default.database = ../writable/database.db
# database.default.DBDriver = SQLite3
..and no I'm in. Cheers!
Reply

#42
@muuucho
> ...and no I'm in. Cheers!

Is SQLite3 the dbdriver being used or the default MySqli? I tried and failed with SQLite3 and PDO only MySqli was successful.
download and make your system directory strict
Reply

#43
(12-09-2019, 07:22 AM)John_Betong Wrote: @muuucho
> ...and no I'm in. Cheers!

Is SQLite3 the dbdriver being used or the default MySqli?  I tried and failed with SQLite3 and PDO only MySqli was successful.
Not sure if I follow you right. I have MySQL installed (I use Xampp) so I have configured $default[] in app/Config/Database.php tlike this:
PHP Code:
public $default = [
        
'DSN'      => '',
        
'hostname' => 'localhost',
        
'username' => 'root',
        
'password' => '',
        
'database' => 'playground',
        
'DBDriver' => 'MySQLi',
        
'DBPrefix' => '',
        
'pConnect' => false,
        
'DBDebug'  => (ENVIRONMENT !== 'production'),
        
'cacheOn'  => false,
        
'cacheDir' => '',
        
'charset'  => 'utf8',
        
'DBCollat' => 'utf8_general_ci',
        
'swapPre'  => '',
        
'encrypt'  => false,
        
'compress' => false,
        
'strictOn' => false,
        
'failover' => [],
        
'port'     => 3306,
    ]; 
...and then I commented out the database settings in .env like this:
PHP Code:
# database.default.database = ../writable/database.db
# database.default.DBDriver = SQLite3 
Reply

#44
@muuucho,
I thought that because the error shown was about SQLite3 that was the selected dbdriver.

I also had problems with the .env settings and prefer the old style even though they are in numerous config files.

My policy is to get it too work then make it better Smile
download and make your system directory strict
Reply

#45
I like to see a complete CRUD on Heroes and/or on Dungeons.
Nice approach with the comments in the code, makes it much easier to learn, thanks!
Reply

#46
@John_Betong SQLite3 is the default driver because it is the fastest and easiest way for a developer to get the code and run it - no need to have or install a database (assuming SQLite3 is available). Developers certainly can still switch the database, either via .env or app/Config/Database.php

@muuucho a full CRUD is high on the priority list! I'd like to see a few different versions, including a RESTful presenter (and eventual controller API) and "classic" methods. Probably add some more database tables too so we can do some example relationship handling and have other options for entities, arrays, and objects.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.