2016年3月25日 星期五
2016年3月18日 星期五
3/18
1.先開eclipse
2.
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "test";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `user`";
$result = $conn->query($sql);
if ($result != null) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["name"]. $row["passwd"]. "<br>";
}
} else {
echo "0 results";
}
$conn->close();
?>
1.先開eclipse
2.
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "test";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM `user`";
$result = $conn->query($sql);
if ($result != null) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["name"]. $row["passwd"]. "<br>";
}
} else {
echo "0 results";
}
$conn->close();
?>
訂閱:
文章 (Atom)