Jump to content

Recommended Posts

I have a large user logon. I decided that as i hate having NULL values I made defaults. I modified the table together with 3 test users. I wanted NOW to test it by entering one record using the primary key. (there is no reference to other tables)

 

Here is what I have minus the 3 rows inserted (This bit works fine).

 

DROP TABLE IF EXISTS `SM3SusersX`;

CREATE TABLE IF NOT EXISTS `SM3SusersX` (

`UserF` varchar(15) NOT NULL default '',

`UserS` varchar(15) NOT NULL default '',

`UserN` varchar(32) NOT NULL default '',

`Friendly` varchar(15) NOT NULL default '',

`Email` varchar(40) NOT NULL default '',

`RollID` varchar(32) NOT NULL default '',

`PageID` tinyint(4) NOT NULL default 0,

`UserKey` varchar(32) NOT NULL default '',

`K_Type` tinyint(4) NOT NULL default 0,

`KeyDate` datetime default NULL,

`Personal` varchar(32) NOT NULL default '',

`P_Type` tinyint(4) NOT NULL default 0,

`KeyAsk` tinyint(4) NOT NULL default 0,

`KeyChange` tinyint(4) default 0,

`User` varchar(32) NOT NULL default '',

`cookieKey` varchar(32) NOT NULL default '',

`current` tinyint(4) NOT NULL default 0,

`Mobile` varchar(14) NOT NULL default '0',

`SMS_Count` varchar(14) NOT NULL default '0',

`Proposed` varchar(32) NOT NULL default '',

`Second` varchar(32) NOT NULL default '',

PRIMARY KEY (`User`)

) ENGINE=MyISAM DEFAULT CHARSET=latin1;

 

 

NOW with 3 rows also added as part of the table creation I I should simply do this.

 

INSERT INTO SM3SusersX User '3e06fa3927cbdf4e9d93ba4541acce86';

 

Error ...

 

#1064 - 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 'User '3e06fa3927cbdf4e9d93ba4541acce86'' at line 1

Link to comment
https://forums.phpfreaks.com/topic/274749-auto-insert-with-missing-fields/
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.