$mysqli = new mysqli();
$mysqli->connect("127.0.0.1", "root","", "mydatabase");
$query = "SELECT productid, name, price FROM product ORDER by name";
$mysqli->real_query($query);
$result = $mysqli->store_result();
while(list($productid, $name, $price) = $result->fetch_row())
echo "($productid) $name: $price
";
$result->free();
?>