Forum index / General Chat / Need Help

Need Help

3 posts · page 1 of 1

post #1
12 August 2005, 12:19 UTC#1
Im working on the site for ESFaceoff.com and I was just wondering how to make a shout box like they have on the Hunt 3 and what Madeteam.com has..can anyone help me out
post #2
12 August 2005, 12:26 UTC#2
learn php or search for them online
post #3
12 August 2005, 14:49 UTC#3

OK..I have a script for the shoutbox..but this is the error im getting

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/wereback/public_html/shoutbox.php on line 23

If anyone knows a thing or 2 about PHP..can you please help me out..heres the script






<?
//the host, name, and password for your mysql
mysql_connect("localhost","wereback","6969buhy");

//select the database
mysql_select_db("wereback_joe");

if($submit)
{
//use the PHP date function for the time
$time=date("h:ia d/j/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','$name', '$message','$time')");
}
?>
<?
//returning the last 5 messages
$result = @mysql_query("select * from shoutbox order by id desc limit 5");

//the while loop
while($r=mysql_fetch_array($result))
{
//getting each variable from the table
$time=$r["time"];
$id=$r["id"];
$message=$r["message"];
$name=$r["name"];
?>
<? echo $time ?><br>
<? echo $name ?><br>
<? echo $message ?><br>
<? } ?>
<form action="<? echo $php_self ?>" method="post">
<INPUT TYPE='TEXT' value='name' NAME='name' SIZE=30 maxlength='100'><br>
<INPUT TYPE='TEXT' value='message' NAME='message' SIZE=30 maxlength='100'>
<input type="submit" name="submit" value="submit">
</form>