$mysqli = new mysqli("localhost", "username", "password","mydatabase", 3306);
$result = $mysqli->query("SELECT * FROM mytable");
while($row = $result->fetch_array()) {
foreach($row as $key => $value) {
echo "$key = $value
\n";
}
}
$result->close();
$mysqli->close();
?>