Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I test a database connection with CodeIgniter?
    primarykey
    data
    text
    <p>I'm trying to learn CodeIgniter, but unfortunately many of the tutorials they list on their wiki are several years old and, based on others' comments, don't work on the newest version of CodeIgniter.</p> <p>I did find one that didn't have any negative comments - on <a href="http://www.ibm.com/developerworks/web/library/wa-codeigniter/index.html#icomments" rel="nofollow">IBM DeveloperWorks</a>- but I can't get it to work. Everything up until the form submit is fine, but after I submit I get a blank page and nothing is sent to the database. </p> <p>How can I test/troubleshoot a database connection in CodeIgniter? I know my settings (as far as host, dbname, username/password, etc.) are correct because I'm using them successfully with a plain vanilla PHP site.</p> <p>Edit to add: alternatively, can anyone point me to a recent beginner tutorial that works with the recent version? I don't need an MVC tutorial; I'm familiar with the design pattern. I just need to learn CodeIgniter.</p> <p>Edit to add database.php file:</p> <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $active_group = "default"; $active_record = TRUE; //$db['default']['hostname'] = "localhost"; $db['default']'hostname'] = "myHostName.powwebmysql.com"; $db['default']['username'] = "myUserName"; $db['default']['password'] = "myPassword"; $db['default']['database'] = "codeigniter"; //yes, database is called codeigniter $db['default']['dbdriver'] = "mysql"; $db['default']['dbprefix'] = ""; $db['default']['pconnect'] = TRUE; $db['default']['db_debug'] = TRUE; $db['default']['cache_on'] = FALSE; $db['default']['cachedir'] = ""; $db['default']['char_set'] = "utf8"; $db['default']['dbcollat'] = "utf8_general_ci"; /* End of file database.php */ /* Location: ./system/application/config/database.php */ </code></pre> <p>EDIT: error message when adding database load to constructor:</p> <pre><code>A PHP Error was encountered Severity: Notice Message: Undefined property: Welcome::$load Filename: controllers/welcome.php Line Number: 6 </code></pre> <p>where line 6 is $this->load->database();</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload