Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
//connect to database
try
{
	$mysql_conn = new PDO ("mysql:host=localhost;dbname=koala", "vompatti", "opossumi");	
}catch (PDOException $e){
	die("Virhe: " . $e->getMessage());
}

// error handling
$mysql_conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// merkistöencoding
$mysql_conn->exec("SET NAMES utf8");

...