thedogsbollocks Posted February 24, 2008 Share Posted February 24, 2008 Hi guys, Struggling with an Insert Into... I'm sure it's something incredibly simple but I'm over-tired and it's driving me completely nuts. mySQL string: INSERT INTO workgroup_plans (title, desc, overseer, creator) VALUES ('Title','Description','27','1') Table Structure: CREATE TABLE `workgroup_plans` ( `id` int(11) NOT NULL auto_increment, `title` text NOT NULL, `desc` text NOT NULL, `overseer` int(11) NOT NULL, `creator` int(11) NOT NULL, `timestamp` date NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; I *know* it's something simple. But my mind just can't see it. Quote Link to comment Share on other sites More sharing options...
paul2463 Posted February 24, 2008 Share Posted February 24, 2008 a couple of things to think about, one maybe true the other one maybe me not thinking straight too 1. in your table structure the timestamp column is a NOT NULL and does not auto increment, therefore for an insert statement to work you must supply it a timestamp of have a default value set. 2. in your table structure the columns overseer and creater are type INT and if you use speech marks around the numbers you are inputting TEXT values, try removing the speech marks I hope i have helped in some small way Paul Quote Link to comment Share on other sites More sharing options...
Barand Posted February 24, 2008 Share Posted February 24, 2008 DESC is a reserved word. Change column name (preferred) or use `desc` Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.