Posted By

elvman on 08/17/11


Tagged


Versions (?)

Connect to database using MySQLi


 / Published in: PHP
 

  1. define('HOST', 'localhost');
  2. define('USER', 'root');
  3. define('PASS', 'root');
  4. define('DATABASE', 'analytics');
  5. define('ENCODING', 'utf8');
  6.  
  7. $database = new mysqli(HOST, USER, PASS, DATABASE);
  8. $database->query('SET NAMES '.ENCODING);

Report this snippet  

You need to login to post a comment.