Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- config.php:
- // Mysqldaten
- $mysqlhost = "localhost";
- $mysqluser = "root";
- $mysqlpass = "";
- $mysqldb = "lukasbook";
- // Verbindung herstellen
- $connection = mysql_connect($mysqlhost, $mysqluser, $mysqlpass) or die ("Verbindungsversuch fehlgeschlagen.");
- // Datenbank auswählen
- $selectdb = mysql_select_db($mysqldb, $connection) or die ("Datenbank konnte nicht ausgewählt werden.");
- showentrys.php:
- require_once "config.php";
- $connection;
- $selectdb;
- $sql_showentrys = "SELECT ID name, email, text FROM entry";
- $query_showentrys = mysql_query($sql_showentrys) or die ("Anfrage nicht erfolgreich.");
- $anzahl_showentrys = mysql_num_rows($query_showentrys);
- echo "Zur Zeit gibt es bereits $anzahl_showentrys Einträge!";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement