Gilbert Posted June 6, 2018 Share Posted June 6, 2018 Hi, I have a goDaddy account and I'm learning to import data. I've had success with a couple of uploads, but I get an error message and I don't understand what I need to do to get rid of it. My code is below, along with the error message I get and the excerpt from the mySQL documentation. Can anyone offer some advice about how to proceed and what may be the problem? The query works and updates the table with the info perfectly, but I think I should find out what this error is b/4 I incorporate into my website. Thanks a million! SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; CREATE TABLE IF NOT EXISTS `myUsers` ( `UserID` char(8) NOT NULL, `firstName` varchar(24) NOT NULL, `lastName` varchar(24) NOT NULL, `viewPref` varchar(16) NOT NULL, `pagePref` varchar(48) NOT NULL, PRIMARY KEY (`UserID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; INSERT INTO `myUsers` (`UserID`, `firstName`, `lastName`, `viewPref`, `pagePref`) VALUES ('sak20007', 'John', 'Smith', 'mobile_phone', 'about.html'); UPDATE; #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 '' at line 1 Error: 1064 SQLSTATE: 42000 (ER_PARSE_ERROR) Message: %s near '%s' at line %d Link to comment Share on other sites More sharing options...
justsomeguy Posted June 6, 2018 Share Posted June 6, 2018 It's probably talking about the last line. Link to comment Share on other sites More sharing options...
Gilbert Posted June 6, 2018 Author Share Posted June 6, 2018 How so justsomeguy? Don't you need to UPDATE after you INSERT INTO? I learned my sql from MS ACCESS, but I realize mySQL has some different syntax. In Access the insert into doesnot update the table until you say 'update'. Have I written it wrong? A little more help, please. Thank you. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 6, 2018 Share Posted June 6, 2018 Quote Don't you need to UPDATE after you INSERT INTO? No. UPDATE is what you use to start an UPDATE query when you are updating the table. It is not a command on its own. You might be thinking of commit, but you only need to commit if you're using transactions, which it doesn't look like you are. When you insert a record outside of a transaction there's nothing else you need to do to actually insert the record, just the insert query will do it. I learned my sql from MS ACCESS My condolences. 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now