I'm new to PHP and the actual workings of Wamp. It seems that it does not matter what ever I enter for username and password, I always connect. If I'm running locally, do they not matter ?
<?php
$servername = "localhost";
$username = "Fred";
$password = "Blogs";
$dbname = "clubs_db";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT MemName FROM members_cams";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "MemName: " . $row["MemName"]. "<br>";
}
}
else {
echo "0 results";
}
$conn->close();
?>
<?php
$servername = "localhost";
$username = "Fred";
$password = "Blogs";
$dbname = "clubs_db";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT MemName FROM members_cams";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "MemName: " . $row["MemName"]. "<br>";
}
}
else {
echo "0 results";
}
$conn->close();
?>