SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2011
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Change database encoding in codeigniter

    Does

    PHP Code:
    mysql_query('SET NAMES `utf8`;'$link); 
    is the same that

    PHP Code:
    $db['default']['char_set'] = 'utf8'
    OR

    PHP Code:
    $db['default']['dbcollat'] = 'utf8_general_ci'
    in "application\config\database.php" on Codeigniter? If not, how can I do it in Codeigniter?

  2. #2
    Founder of Primal Skill Ltd. feketegy's Avatar
    Join Date
    Aug 2006
    Posts
    482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    CodeIgniter has a config file that lets you store your database connection values (username, password, database name, etc.). The config file is located at application/config/database.php. You can also set database connection values for specific environments by placing database.php it the respective environment config folder.
    More on this page: http://codeigniter.com/user_guide/da...iguration.html

    Place a database.php in your application/config folder and edit the file to suit your needs.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •