Meine Code auf kommenter_verwalter.php jetzt sie siehst aus so,
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include 'classprove.php';
$New = new ClassProveContakt3();
$New -> writeCommentToDatabas();
$New -> getMessages();
class ClassProveContakt2
{
private $dbHost = 'localhost'; # Host der Datenbank
private $dbName = 'meine'; # Name der Datenbank
private $dbUser = 'root'; # Name phpmyadmin
private $dbPass = 'pass'; # Passwort
private $Name;
private $Email;
private $Message;
private $PostOK;
private $datetime;
private $items;
private $ip;
private $db;
function writeCommentToDatabas()
{
// Establish connection with MYSQL Server
try
{
$db = new PDO("mysql:host=localhost;dbname=meine", "root", "pass");
}
catch (PDOException $pe)
{
echo "<br>Cannot connect to database: " . $pe->getMessage();
return false;
}
if(isset($_POST["delete"])) {
try {
require classprove.php;
$connection = new PDO($id, $name, $email, $message, $datetime, $ip);
$id = $_POST["id"];
$sql = "DELETE FROM mela WHERE id = :id";
$statement = $connection->prepare($sql);
$statement->bindValue(':id', $id);
$statement->execute();
$success = "User successfully deleted";
}catch(PDOException $error) {
echo $sql . "<br>" . $error->getMessage();
}
}
}
function tabelle()
{
$arrRows = $New->getMessages();
if ($arrRows)
{
echo "<table id='user' class='table table-bordered'>
<tr>
<th>id</th>
<th>name</th>
<th>email</th>
<th>message</th>
<th>datetime</th>
<th>ip</th>
<th>Delete User</th>
</tr>";
foreach ($arrRows as $row){
echo <<<EOT
<form action="classprove.php" method="post">
<tr>
<td>{$row['id']}</td>
<td>{$row['name']}</td>
<td>{$row['email']}</td>
<td>{$row['datetime']}</td>
<td>{$row['ip']}</td>
</tr>
</form>
EOT;
}
echo "</table>";
}
}
}
$News = new ClassProveContakt2();
$News -> getMessages();
$News -> tabelle();
$News -> $arrRows;
Wenn mache sudo tail -n0 -f /var/log/apache2/error.log /var/log/mysql/error.log
Bekomme dieser Warnung ,
PHP Parse error: syntax error, unexpected end of file in /var/www/html/kommenter_verwalter.php on line 120
und ich weiß nicht warum bekomme , weil alle Funktionen sind gute geschossenen ...