![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 47 Pomógł: 0 Dołączył: 20.11.2010 Ostrzeżenie: (0%) ![]() ![]() |
Próbowałem napisać prosty formularz, ale nic z tego nie wyszło... Pojawia się Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /x/public_html/newthread.php on line 30.
Kod <?php ob_start(); require 'includes/config.php'; session_start(); $number = $_GET['id']; $user = $_SESSION['user_id']; if(empty($_GET)) { echo "nie wybrano nic"; } else {?> <form method="post">Tytuł wątku: <input type="text" name="name" size="50" /><br> Opis wątku: <input type="text" name="desc" size="50" /><br> Treść: <br><textarea name="text" cols="15" rows="30"></textarea><br> <input type="submit" value="Wyslij!" /> <?php } $name=$_POST["name"]; $desc=$_POST["desc"]; $text=$_POST["text"]; $user=$_POST["user"]; $zapis = "INSERT INTO threads (id, pid, name, desc, author, text, date) VALUES ('', 'x', '$name', '$desc', '$text', '$user', '')"; $wyn = mysql_query($zapis); $dane = mysql_fetch_array($wyn); echo "x ".$_POST["name"]." został wysłany."; ob_end_flush(); ?> Czy ktoś mógłby powiedzieć co zrobiłem źle? Ten post edytował IceBeast 16.02.2011, 20:00:23 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 4.10.2025 - 23:57 |