This is pretty easy in PHP:
$con = mysql_connect("localhost:".$LOCAL_DB_PORT, $LOCAL_DB_USER, $LOCAL_DB_PASS);
mysql_select_db("db", $con);
mysql_query("set names utf8", $con);
$result = mysql_query("select ...");
while($row = mysql_fetch_assoc($result))
{
...
}
But what's the easiest way to do it with c/c++ in windows?