Limitierte Anzahl Datens├Ątze



Der folgende Script liest eine limitierte Anzahl Datens├Ątze aus einer Datenbank aus.


<?php

$servername = "youservername";
$username = "yourusername";
$password = "yourpassword";
$dbname = "yourdbname";

$con = mysqli_connect($servername,$username,$password,$dbname);

$res = mysqli_query($con, "SELECT * FROM data LIMIT 3");

$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);

?>



created by NETTECS.ch