Jump to content

Recommended Posts

I have the following table in a mysql database:

 

CREATE TABLE IF NOT EXISTS `CASE` (

  `CASE_NUM` bigint(20) unsigned NOT NULL auto_increment,

  `DATE` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,

  `PERSON_ID` int(11) NOT NULL,

  `RESIDENCY_DETAILS_ID` int(11) NOT NULL,

  `MORT_COMP_ID` int(11) NOT NULL,

  `LOAN_ID` int(11) NOT NULL,

  `INTAKE_REPRE_ID` int(11) default NULL,

  `COUNSELOR_ID` int(11) default NULL,

  PRIMARY KEY  (`CASE_NUM`),

  UNIQUE KEY `PERSON_ID` (`PERSON_ID`),

  UNIQUE KEY `RESIDENCY_DETAILS_ID` (`RESIDENCY_DETAILS_ID`),

  UNIQUE KEY `LOAN_ID` (`LOAN_ID`),

  KEY `INTAKE_REPRE_ID` (`INTAKE_REPRE_ID`),

  KEY `COUNSELOR_ID` (`COUNSELOR_ID`),

  KEY `MORT_COMP_ID` (`MORT_COMP_ID`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

 

And I am trying to insert data to it. I have tried all of the following pieces of SQL code:

 

insert into CASE (PERSON_ID, RESIDENCY_DETAILS_ID, MORT_COMP_ID, LOAN_ID, INTAKE_REPRE_ID, COUNSELOR_ID) values (1, 2, 3, 4, 5, 6);

 

insert into CASE (PERSON_ID, RESIDENCY_DETAILS_ID, MORT_COMP_ID, LOAN_ID) values (1, 2, 3, 4);

 

insert into CASE (DATE, PERSON_ID, RESIDENCY_DETAILS_ID, MORT_COMP_ID, LOAN_ID, INTAKE_REPRE_ID, COUNSELOR_ID) values ("2003-12-31 01:02:03", 1, 2, 3, 4, 5, 6);

 

None of them work! They all generate a syntax error. Can anyone help me figure out what is wrong with it?

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/135234-sql-syntax-error/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.