[GELÖST] MySql: mysql_fetch_array():

uro, dein Code ist, gelinde gesagt, sehr falsch. :wink:
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]

scram! deine version funktioniert! DANKE WUSA nach 3 tagen :smiley:

ich danke allen anderen auch =))

Boah… hätte ich gewusst dass da register_global dinger sind… Wer sowas macht sollte erschossen werden.
Ich hab früher immer mit GET usw. gearbeitet, obwohl ich nichtmal wusste, dass man einfach $bla machen kann statt $_GET[“bla”] wo register_globals an ist.
Naja immerhin wurde dein Problem gelöst