Skip to content

Instantly share code, notes, and snippets.

@dominikzogg
Created January 8, 2012 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dominikzogg/1578531 to your computer and use it in GitHub Desktop.
Save dominikzogg/1578531 to your computer and use it in GitHub Desktop.
very simple mysql encoding tester written in php
<?php
//header('content-type: text/html; charset=latin1');
header('content-type: text/html; charset=utf8');
$connection['host'] = "localhost";
$connection['username'] = "";
$connection['password'] = "";
$connection['database'] = "";
// ***************************************
if(!$link = mysql_connect($connection['host'], $connection['username'], $connection['password']))
{
die(mysql_error());
}
// ***************************************
if(!$db = mysql_select_db($connection['database'], $link))
{
die (mysql_error());
}
// ***************************************
$result = mysql_query("SELECT * FROM fe_page", $link);
while($row = mysql_fetch_assoc($result))
{
print_r($row);
}
// ***************************************
mysql_close($link);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment