AND-Operator
|
Mit dem AND-Operator können Datensätze ausgelesen werden, die zwei oder mehreren Kriterien entsprechen. |
<?php
$servername = "yourservername";
$username = "yourusername";
$password = "yourpassword";
$dbname = "yourdbname";
$con = mysqli_connect($servername,$username,$password,$dbname);
$res = mysqli_query($con, "SELECT * FROM data WHERE name='Meyer' AND vorname='Hans'");
$num = mysqli_num_rows($res);
if($num > 0) echo "";
else echo "Keine Ergebnisse ";
echo "
";
while ($dsatz = mysqli_fetch_assoc($res))
{
echo "";
echo "" . $dsatz["name"] . " | ";
echo "" . $dsatz["vorname"] . " | ";
echo "" . $dsatz["email"] . " | ";
echo " ";
}
mysqli_close($con);
?>
|