NOT IN-Operator
|
Mittels NOT IN-Operator werden Datensätze aufgelistet, die die Bedingung nicht erfüllen.
|
<?php
$servername = "yourservername";
$username = "yourusername";
$password = "yourpassword";
$dbname = "yourusername";
$con = mysqli_connect($servername,$username,$password,$dbname);
$res = mysqli_query($con, "SELECT * FROM data WHERE vorname NOT IN ('Hans', 'Fritz')");
$num = mysqli_num_rows($res);
if($num > 0) echo "";
else echo "Keine Ergebnisse<br>";
echo "<br><table>";
while ($dsatz = mysqli_fetch_assoc($res))
{
echo "<tr>";
echo "<td>" . $dsatz["name"] . "</tD>";
echo "<td>" . $dsatz["vorname"] . "</a></tD>";
echo "<td>" . $dsatz["email"] . "</tD>";
echo "</tr>";
}
mysqli_close($con);
?> |