So.. I dont know why i cant find a specific tutorial / tip on this, so i'll ask you guys.
I'm trying to get $date to get the current date and insert it as the query executes.
$result=mysql_query("INSERT INTO articles (`loginid`,`title`,`author`,`body`,`date`,`category`) VALUES ('$loginid','$title','$author','$body','$date','$category')")
this is my Database.
CREATE TABLE `articles` (
`id` int(20) NOT NULL auto_increment,
`loginid` varchar(19) NOT NULL,
`title` varchar(25) NOT NULL,
`author` varchar(30) NOT NULL,
`body` text NOT NULL,
`date` date NOT NULL default '0000-00-00',
`category` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=39 DEFAULT CHARSET=latin1 AUTO_INCREMENT=39 ;
i have tried different date formats like getdate, strftime(, strtotime etc.
But i get this error when i try execute the post script.
Insert Error: 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 '<<<$body text was here i just changed it to this>>>>