php kode i Joomla
Jeg prøver at få denne kode til at virke er der en der kan hjælpeproblemet er at jeg gerne vil have to WHERE i samme sætningen ?
{source}
<!DOCTYPE html>
<html>
<head>
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<?php
$servername = "xxx";
$username = "xxxx";
$password = "xxxxx";
$dbname = "xxxx";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "SELECT * FROM ringsalg,ringsalgsvarer where ringsalg.id = ringsalgsvarer.parent_id and where medlemsnr = 055";
$result = $conn->query($sql);
if ($result->num_rows > 0){
echo "<table><tr><th>ID</th><th>Navn</th><th>Adresse</th><th></th></l</th><th>Ringe</th><th>Mail</th><tr>";
// output data of each row
while($row = $result->fetch_assoc())
{
echo "<tr><td>" . $row["parent_id"]. "</td>
<td>" . $row["navn"]. "</td>
<td> " . $row["adresse"]. "</td>
<td> " . $row["ringe"]. "</td>
<td>" . $row["mail"]."</td>
<td>" . $row["medlemsnr"]."</td></tr>";
}
echo "</table>";
} else {
echo "0 results";
}
$conn->close();
?>
</body>
</html>
{/source}