Od dluzszego czsu poszukuje shoutbox, takiego najprostrzego ale wszystkie ktore znjaduja maja jakies bezesowne emoty, formularze jak wbanku (oczywisce chodzi o ilosc pol do wpelnienia )
i w koncu znalazlem jednak nie pliki lecz kod
http://www.spoono.com/php/tutorials/tutorial.php?id=19
I wstawilem te kody do jednego pliku zeby to sprawdzci, utworzylem tabele itp, jednak gdy go odpalam to wyswietla mi sie komunikacik
Cytat
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /srv/www/htdocs/web26/html/test2/index.php on line 34
gdzie linia 34 to
29 <?
30 //returning the last 5 messages
31 $result = mysql_query("select * from shoutbox order by id desc limit 5");
32
33 //the while loop
34 while($r=mysql_fetch_array($result))
35 {
36 //getting each variable from the table
37 $time=$r["time"];
38 $id=$r["id"];
39 $message=$r["message"];
40 $name=$r["name"];
41 ?>
42 <? echo $time ?><br>
43 <? echo $name ?><br>
44 <? echo $message ?><br>
45 <? } ?>
domyslecie sie o co chodzi bo ja juz nie kumam
a zreszta macie tu caly kod jak stronka znieknie to bedzie chociaz tutaj dla przyszlych pokolen :]
<? //the host, name, and password for your mysql //select the database if($submit) { //use the php date function for the time // inserting it into the shoutbox table which we made in the mysql statements befo e \"VALUES ('NULL','$name', '$message','$time')\"); } ?>
<? //returning the last 5 messages //the while loop { //getting each variable from the table $time=$r[\"time\"]; $id=$r[\"id\"]; $message=$r[\"message\"]; $name=$r[\"name\"]; ?> <? } ?>
i formularz
<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>