uro, dein Code ist, gelinde gesagt, sehr falsch.
Dieser hier wurde getestet (zumindest auf Syntax-Fehler):C:\php5\scripts$ php -l test.php
No syntax errors detected in test.php
[code]<?php
//the host, name, and password for your mysql
mysql_connect(“localhost”,“ashley4fans”,“SAG ICH NICHT”);
//select the database
mysql_select_db(“ashley4fans”);
if(isset($_POST[‘submit’]))
{
//use the PHP date function for the time
$time=date(“h:i d.m.Y”);
// inserting it into the shoutbox table which we made in the mysql statements before
$result=MYSQL_QUERY(“INSERT INTO shoutbox (id,name,message,time)”.
“VALUES (NULL,’” . $_POST[‘name’] . “’, '” . $_POST[‘message’] . “’,’$time’)”);
}
//returning the last 5 messages
$result1 = mysql_query(“SELECT * FROM shoutbox
ORDER BY id
DESC LIMIT 5”) or die(mysql_error());
//the while loop
while($r=mysql_fetch_array($result1))
{
//getting each variable from the table
$time=$r[“time”];
$id=$r[“id”];
$message=$r[“message”];
$name=$r[“name”];
echo $time;
echo $name.’
’;
echo $message.’
’;
}
?>
[/code]