Problems with inserting tables to database...

A

Anonymous

Guest
Im makeing this news submiting system but then i post news, nothing happens :S
Code:
<?php
include("connect.php");
$headline = $_POST['headline'];
$postedby = $_POST['postedby'];
$content = $_POST['content'];
$date =  date("l dS of F Y h:i:s A");
$password = $_POST['password'];
if ($passord="xxx"){
mysql_query("INSERT INTO `n1_news` ( `id` , `headline`, `dato` , `postedby` , `content`) VALUES ('', '$headline' '$date', '$postedby', '$content');");
echo "Thanks For Posting News.<br>You are now getting redirected...";
}
else {
echo "That password was wrong my friend...";
die;
}
?>
when i post i get this message:
Thanks For Posting News.
You are now getting redirected...

its probably a simple answer cuz its about 3am an i need some sleep...
:help:
 
Echo the query and see if it looks like you expect it to. Paste it into a MySQL client and see if you get any errors. Then paste it here.
 
You miss a comma in your query between $headline and $date:
Code:
... VALUES(... '$headline' '$date' .... );
I suggest you to always use or die(mysql_error()); After your mysql_query(), so you can see what´s happening!
 
yay, i fixed it... god knows how but i did it :D
thx all!!!
 
Back
Top