![]() |
![]() |
![]()
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 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 47 Pomógł: 0 Dołączył: 20.11.2010 Ostrzeżenie: (0%) ![]() ![]() |
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, author, text, date) VALUES ('', 'x', '', '', '', '', '')' at line 1
A oto screen tabeli threads: (IMG:http://i56.tinypic.com/25ix2zc.png) Po dodaniu tego drugiego kodu: Kod Array
( ) Ten post edytował IceBeast 16.02.2011, 20:11:07 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 14.10.2025 - 14:36 |