Using the Object-Oriented Syntax in MySQLi
<?php
$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<BR/>\n";
}
}
$result->close();
$mysqli->close();
?>
Related examples in the same category