Mysql Error 1064 You Have Error Your Sql Syntax
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about
Mysql Server Version For The Right Syntax To Use Near '' At Line 1
hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask #1064 - you have an error in your sql syntax phpmyadmin Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join
1064 Mysql
them; it only takes a minute: Sign up #1064 -You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version up vote 5 down vote favorite 1 I'm new to PHP and mysql error 1064 (42000) MySQL and ran into a little trouble with a learning project I'm working on. Whenever I try to create a table CREATE TABLE transactions( id int NOT NULL AUTO_INCREMENT, location varchar(50) NOT NULL, description varchar(50) NOT NULL, category varchar(50) NOT NULL, amount double(10) NOT NULL, type varchar(6) NOT NULL, notes varchar(512), receipt int(10), ) I get the following error message: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL check the manual that corresponds to your mysql server version for the right syntax to use near server version for the right syntax to use near ') NOT NULL, type varchar(6) NOT NULL, notes varchar(512), receipt int(10), ' at line 6** Here is some info on what I'm working with •Server type: MySQL •Server version: 5.5.32 - MySQL Community Server (GPL •phpMyAdmin: 4.0.4.1, latest stable version: 4.1.7 I've spent a day knocking my head against the wall over this and now I think its time to ask for help.I was wondering if anyone can tell me what I'm doing wrong? mysql error-handling create-table share|improve this question edited Nov 17 '14 at 4:45 Ataboy Josef 1,138821 asked Feb 15 '14 at 13:54 tsjr63 26112 4 You have a comma at the end of the receipt line. –Gordon Linoff Feb 15 '14 at 13:57 add a comment| 5 Answers 5 active oldest votes up vote 5 down vote Remove the comma receipt int(10), And also AUTO INCREMENT should be a KEY double datatype also requires the precision of decimal places so right syntax is double(10,2) share|improve this answer edited Feb 15 '14 at 15:37 answered Feb 15 '14 at 13:58 G one 2,0391514 This answer is partly correct. It did not answer on what the error message returned. –Ravinder Reddy Feb 15 '14 at 14:32 @Ravinder: Thanks I missed one thing :) –G one Feb 15 '14 at 15:38 add a comment| up vote 1 down vote On
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this
Sql Syntax Error Checker
site About Us Learn more about Stack Overflow the company Business Learn more mariadb server version for the right syntax about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss
Error 1064 Mysql 42000 Mysqldump
Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up #1064 - You http://stackoverflow.com/questions/21798464/1064-you-have-an-error-in-your-sql-syntax-check-the-manual-that-corresponds-t have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' up vote 0 down vote favorite 2 This is the code. However I kept getting this error 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the http://stackoverflow.com/questions/29446697/1064-you-have-an-error-in-your-sql-syntax-check-the-manual-that-corresponds right syntax to use near ')' at line 7 Weirdly line 7 is the CREATE TABLE academicnews( line. Which does not contain ')' . CREATE TABLE academicnews( anewsID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, title VARCHAR(50) NOT NULL, anewsContent TEXT NOT NULL, imagePath VARCHAR(200) NOT NULL, timeNews DATE NOT NULL, ); #Line 7 mysql mysql-error-1064 share|improve this question edited Apr 4 '15 at 13:04 Rizier123 47.4k134673 asked Apr 4 '15 at 12:59 user3526002 1802314 Why does adding comment like --Comment gives error as well? –user3526002 Apr 4 '15 at 13:36 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote accepted Get rid of the last comma. It is unnecessary and invalid. CREATE TABLE academicnews( anewsID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, title VARCHAR(50) NOT NULL, anewsContent TEXT NOT NULL, imagePath VARCHAR(200) NOT NULL, timeNews DATE NOT NULL, <-- HERE ); It should be CREATE TABLE academicnews( anewsID INT NOT NULL PRIMARY KEY AUTO_INCREMENT, title VARCHAR(50) NOT NULL, anewsContent TEXT NOT NULL, imagePath VARCHAR(200) NOT NULL, timeNews DATE NOT NULL ); share|improve this answer answered Apr 4 '15 at 13:00 community wiki John Conde add a
error in your SQL syntax InMotion Hosting SubscribeSubscribedUnsubscribe3,0393K Loading... Loading... Working... Add to Want to watch this again later? Sign in to add this video to a playlist. Sign in Share More Report Need to report the video? Sign in to report inappropriate content. Sign in https://www.youtube.com/watch?v=YahEc-ybraY Statistics 37,420 views 28 Like this video? Sign in to make your opinion count. Sign in 29 4 Don't like this video? Sign in to make your opinion count. Sign in 5 Loading... Loading... Loading... Rating is available when the video has been rented. This feature is not available right now. Please try again later. Published on Dec 8, 2014The 1064 syntax error for MySQL is very common. Here we go over some of the more error 1064 common error types (Reserved Words, Missing Data, Mistyped Commands, and Obsolete Commands) and how to correct them. You can also learn more at our Support Center article on the subject.http://www.inmotionhosting.com/suppor... Category Science & Technology License Standard YouTube License Show more Show less Loading... Autoplay When autoplay is enabled, a suggested video will automatically play next. Up next MySQL Tutorial for Beginners - 1 - Creating a Database and Adding Tables to it - Duration: 8:50. primetubervideos 662,121 server version for views 8:50 How to solve incorrect syntax near 's'. - Duration: 6:44. Innovative learning 2,007 views 6:44 Tutorial on How to Solve MySQL Errors - Duration: 5:42. Marco 23,262 views 5:42 How to Fix MySQL/PHPMyAdmin #1045 Error - Duration: 3:53. TNWProduction 44,003 views 3:53 MySQL Error number:1045 Resolved - Duration: 4:39. RGN TAMIL 74,977 views 4:39 Fix 1064 Sql Error With New Techinque By Ali Khan - Duration: 9:12. Devil Killer 1,106 views 9:12 PHP MySQL Tutorial: Create a Database and Table in phpMyAdmin -HD- - Duration: 11:26. RiverCityGraphix 284,428 views 11:26 SQL Basics - Lesson 1 - Introduction - Duration: 31:50. masti supreme 567,395 views 31:50 Error 1064 when restoring a mysql dump - Duration: 1:20. Adarsh Agarwal 542 views 1:20 Solution : phpmyadmin.pma_table_uiprefs doesn't exist - Duration: 1:51. Learn Some Thing 9,198 views 1:51 Fix #1046 - No database selected - Duration: 1:01. itcs program 23,143 views 1:01 MySQL Tutorial - Duration: 41:10. Derek Banas 667,351 views 41:10 Introduction to MySQL for Website Administrators - Duration: 28:41. Eli the Computer Guy 94,707 views 28:41 MySQL Tutorial 1 - What is MySQL - Duration: 9:32. CalebTheVideoMaker2 189,157 views 9:32 1046 Error in SQL In phpMyAdmin[Solved] - Duration: 1:34. Zaroon bin hadi 360 views 1:34 MySQL Querying Data - Lesson 1, Part 1 - How To Write a Basic SQL Select Statement - Duration: 13:20. ericm1000 105,78