<?php
$mysqli = new mysqli("127.0.0.1", "root","", "mydatabase");
$query = "SELECT productid, name, price, description FROM product ORDER BY productid";
$stmt = $mysqli->prepare($query);
$stmt->execute();
$stmt->bind_result($productid, $name, $price, $description);
while($stmt->fetch()) {
echo "$productid, $name, $price, $description <br />";
}
$stmt->close();
$mysqli->close();
?>
|