hej
jeg har det samme problem som jeg havde for ikke ret længe siden... det er et mysql input
kode:
<?php
include("header.php");
include("admin.php");
include("db.php");
if ($_GET[action] == "write") {
?>
<form action="news-admin.php?action=write-ok" method="post">
Forfatter: <input type="text" name="forfatter" value="<? echo $_SESSION['nick']; ?>" READONLY><br>
Overskrift: <input type="text" name="subject" value=""><br>
Text: <textarea rows="15" cols="30" name="text"></textarea><br>
<input type="submit" value="Gem"><br>
</form>
<?
} elseif ($_GET[action] == "write-ok") {
$time = time();
$forfatter = $_POST['forfatter'];
$overskrift = $_POST['subject'];
$text = $_POST['text'];
mysql_query("INSERT INTO news (by, text, time, title) VALUES ('".$forfatter."','".$text."', '".$time."','".$subject.")") or die(mysql_error());
}
include("footer.php");
?>
fejl:
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 'by, text, time, title) VALUES ('[TSV]Dandyman','hej', '10797657