Jump to content

Not Seeing [Probably Simple] Syntax Problem


thedogsbollocks

Recommended Posts

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.

 

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.