InMotion Hosting Support Center

In this tutorial:


When working with programs that have a database, you face the possibility of having database errors as well as regular php errors. This guide explains what the 1064 error is, some likely causes, and general troubleshooting

Causes for the 1064 error

This error message may seem cryptic at first. That is because it is a general MySQL error pointing to a syntax error of some sort in the SQL Query statement. This error can have multiple causes which are explained below

Using reserved words

Every version of MySQL has its own list of reserved words. These are words that are used for specific purposes or perform specific functions within the MySQL engine. If you attempt to use one of these reserved words, you will receive the 1064 error. For example, below is a short SQL query that uses a reserved word as a table name.

CREATE TABLE alter (first_day DATE, last_day DATE);

How to fix it:
Just because the word alter is reserved does not mean it cannot be used, it just has special requirements to use it as the MySQL engine is trying to call the functionality for the alter command. To fix the issue, you will want to surround the word with backticks �`�, this is usually the button just to the left of the "1" button on the keyboard. The code block below shows how the code will need to look in order to run properly.

CREATE TABLE `alter` (first_day DATE, last_day DATE);

Missing Data

Sometimes data in the database is missing. This can cause issues when this data is required for a query. For example, if a database is built requiring an ID number for every student, it is reasonable to assume a query will be built to pull a student record by that ID number. Such a query would look like:

SELECT * from students WHERE studentID = $id
If the $id is never properly filled in the code, the query would look like this to the server:
SELECT * from students WHERE studentID =
Since there is nothing there, the MySQL engine gets confused and complains via a 1064 error.

How to fix it:
Hopefully your application will have some sort of interface that will allow you to bring up the particular record and add the missing data. This is tricky because if the missing data is the unique identifier, it will likely need that information to bring it up, thus resulting in the same error. You can also go into the database (typically within phpMyAdmin) where you can select the particular row from the appropriate table and manually add the data.

Mistyping of Commands

One of the most common causes for the 1064 error is when a SQL statement uses a mistyped command. This is very easy to do and is easily missed when troubleshooting at first. Our example shows an UPDATE command that is accidentally misspelled.

UDPATE table1 SET id = 0;

How to fix it:
Be sure to check your commands prior to running them and ensure they are all spelled correctly.

Below is the syntax for the correct query statement.

UPDATE table1 SET id = 0;

Obsolete Commands

Some commands that were deprecated (slated for removal but still allowed for a period of time) eventually go obsolete. This means that the command is no longer valid in the SQL statement. One of the more common commands is the 'TYPE' command. This has been deprecated since MySQL 4.1 but was finally removed as of version 5.1, where it now gives a syntax error. The 'TYPE' command has been replaced with the 'ENGINE' command. Below is an example of the old version:

CREATE TABLE t (i INT) TYPE = INNODB;
This should be replaced with the new command as below:
CREATE TABLE t (i INT) ENGINE = INNODB;

Summary

As you can see there is more than one cause for this type error within MySQL code. This list will be updated as more specific instances are reported.

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

   
Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
You have an error in your SQL syntax
Help with a 1064 error
mysql5.6.17 comman line cannot create my passworddddd
How Do I Fix MySQL Error #1064?
Notice: Error: You have an error in your SQL syntax
what's the Database server address
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
n/a Points
2017-11-13 6:33 pm

("SELECT c.Data_ID, c.Lead__c, c.Opportunity__c, c.Project__c,c.`Account Name`,c.`Account Number`,c.`Opportunity Owner`,c.`Opportunity Owner Manager`,c.`Opportunity Owner Department`,"

"c.`Opportunity Owner Division`,c.`Lead Created Date`,c.`Opportunity Created Date`,c.`Qualification Date`,c.`First Solution Review Date`,c.`Last Solution Review Date`,c.`First Solution Review Held Date`,c.`Last Solution Review Held Date`,"

"c.`Sale Date`,c.`Original Lead Source`,c.`Original Referral Code`,c.`Original Marketing Channel`,c.`Original Marketing Partner`,c.`Lead Source`,c.`Referral Code`,c.`Marketing Channel`,"

"c.`Marketing Partner`,c.`Lead Status`,c.`Lead Status Detail`,c.`Opportunity Stage`,c.`Opportunity Stage Detail`,c.`Project Status`,c.`Project Phase`,c.`Project Phase Detail`,"

"c.`Gross Sale`,c.`Net Sale`,c.Cancellation"

"FROM analytics.customer as c;")

Gets me an "(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 '.customer as c' at line 1")" error please help!!!!

This code works perfectly fine in mysql but crashes when running from a python script.

Staff
1,598 Points
2017-11-13 8:35 pm
From what the error is indicating, there is an issue with the code "FROM analytics.customer as c;" for the version of MySQL that you are running. Is it possible that Python is using an alternative module or version of MySQL that could be causing the different behavior/unexpected error? Also, if you are able to find the MySQL version you are using, you can typically determine the corrective action to take by reviewing their documentation online for that particular version. I hope this helps, feel free to comment and provide any additional details regarding the error and version(s). With that information we may be able to review this further for you.
n/a Points
2017-11-08 5:25 pm

I am unable to figure out why I am getting this error message when trying to create a trigger in phpMyAdmin. Here is the SQL that I am trying to run:

 

create trigger timeupdate after insert on posts

for each row

begin

update threads set latestupdate = now() where threadid in 

(select * from threads t, posts p where p.threadid = t.threadid and p.postid = last_insert_id());

update boards set latestupdate = now() where categoryid in 

(select * from boards b, thread t, posts p where p.postid = last_insert_id() and p.threadid = t.threadid and b.categorynumber = t.categorynumber);

end;

 

postid in the posts table is auto-incremented. posts table has a foreign key to the threads table via a threadid. Likewise, threads has a foreign key to the boards table via categorynumber. The error message says:

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 6 

 

Line 6 is the line that starts with (select *) in the first update statement.

 

Can anyone please help refine this statement? Thanks!

Staff
30,194 Points
2017-11-09 10:17 am
Try removing the first and last parentheses from line 6. Also, here is some helpful information on the SQL SELECT Statement.

Thank you,
John-Paul
n/a Points
2017-11-02 1:16 am

I keep getting a syntax error from line 1 

CREATE TABLE Car Dealer(LicensePlate varchar not null,PickUpDate integer not null,OfficeName varchar not null,time_id integer not null,Risk integer not null,Amount integer not null,Discount integer not null,PRIMARY KEY (LicensePlate,PickUpDate,OfficeName, time_id,Risk),FOREIGN KEY(LicensePlate) REFERENCES Rentals (LicensePlate),FOREIGN KEY (Location) REFERENCES Sales (LicensePlate),FOREIGN KEY (DroffOffDate) REFERENCES Rentals (LicensePlate),FOREIGN KEY (PickUpPlace) REFERENCES Rentals (LicensePlate),FOREIGN KEY (DropOffPlace) REFERENCES Rentals (LicensePlate),FOREIGN KEY (PickUpDate) REFERENCES Rentals (PickUpDate),FOREIGN KEY (LicensePlate) REFERENCES Cars (LicensePlate),FOREIGN KEY (LicensePlate) REFERENCES Insurance (LicensePlate),FOREIGN KEY (LicensePlate) REFERENCES Sales (LicensePlate),FOREIGN KEY (PickUpDate) REFERENCES Insurance (PickUpDate));

Staff
13,791 Points
2017-11-02 6:57 am
Can you provide us the full error message? It should tell you approximately where the syntax error is in your SQL statement.
n/a Points
2017-10-27 8:25 am

Any idea what might of happen here  please and thank you

QUERY ERROR: 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 1Query was UPDATE users SET merits=merits+1, mgang=0 WHERE userid=

Staff
13,791 Points
2017-10-27 8:43 am
We need to see this actual query to troubleshoot syntax errors. Can you provide it?
n/a Points
2017-10-13 4:38 am

Query :

ALTER TABLE `sample` ADD `Phone` DOUBLE(15) NOT NULL AFTER `LastName`;

This error is Continuously poping up not able to add rows or create table:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') NOT NULL  AFTER `LastName`' at line 1

Staff
9,867 Points
2017-10-13 8:58 am
Have you tried running this query without the backticks (``)?
n/a Points
2017-10-06 10:20 pm

hello, everyone. please help me to find out what are the problems with my code? I just like to insert a TIMESTAMP in my table to record the time and date everytime I inserting a new info and edit an existing info.

why #1064 error found? please check my code below. all helps are highly appreciated. ^__^.

 

INSERT INTO 'kaigo' (`id`, `timedate`, `job_name`, `work_place`, `hourly_wage`, `work_day`, `holidays`, `transpo_exp`, `transpo_info`, `time_info`, `job_desc`, `salary`, `post`)

VALUES ( NULL, NOW(),'1' );

Staff
9,867 Points
2017-10-09 11:08 am
It's possible that SQL could be throwing the error because some of the fields are not receiving a value. Have you been able to run this query successfully before?
n/a Points
2017-10-01 2:56 am

Hello Sir,

 

i a getting this type of error creating each and every table how to slove this..

#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 '1)NOT NULL) ENGINE=innoDB at line 1

 

 

CREATE TABLE `alenayah`.`cakes` ( `cake_id` VARCHAR(50) NOT NULL ,`cake_name` VARCHAR(50) NOT NULL , `description` VARCHAR(50) NOT NULL ,`cake_price` VARCHAR(50) NOT NULL , `cake_image` TEXT NOT NULL , `category`VARCHAR(155) NOT NULL , `status` ENUM(1) NOT NULL ) ENGINE = InnoDB;

Staff
40,163 Points
2017-10-02 10:33 am
Hello,

The error appears to be related to the ENUM statement. You can check the document on proper usage here. If you are unfamiliar with the proper usage after reading the documentation, then you will need to speak with an experienced developer for further assistance.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
n/a Points
2017-09-18 5:17 am

I have the same error 1064

SELECT Iscritti.*, IF(SCADENZA>=curdate(),'<img src=\"images/green.png\">','<img src=\"images/red.png\">') AS STATUS FROM Iscritti WHERE  (cognome  like '$word%' OR nome  like '$word%' OR Insegnante like '$word%' OR CONCAT(nome,' ', cognome) LIKE '$word%') AND Attivo = 'SI'ORDER BY scadenza ASC  " ;

 

} else {$queryc="SELECT Iscritti.*, IF(SCADENZA>=curdate(),'<img src=\"images/green.png\">','<img src=\"images/red.png\">') AS STATUS FROM Iscritti WHERE Attivo = 'SI' ORDER BY scadenza ASC

Staff
422 Points
2017-09-18 11:32 am
Hello,

There are several syntax errors in both of those lines, Based on the else statement it looks like you may be using PHP to try and execute an SQL query with variables instead of SQL directly. Depending on your code MySQL could be interpreting parts of a variable or the ' and " as MySQL syntax when it is not intended to be. I would recommend enabling MySQL query log on your server if you have access to see exactly what the query looks like to MySQL so you can be sure that MySQL is getting a valid query. I would also recommend using PDO prepared statement for your queries as doing it that way will prevent MySQL from interpreting quotations around variables or special characters within the variables from being interpreted as MySQL syntax. More info on prepared statements can be found here

Best Regards,
Kyle M
n/a Points
2017-08-24 5:32 pm

This is my code. I don't understand what I am doing wrong. My declare doesn't work either in just a straight query or in a stored procedure defintion. I have tried it with "@" and I have tried it without a "@" and I get the same message. When I try to run it without a declare statement I get an error about an undefined variable.

CREATE TEMPORARY TABLE FirstDayOfMonths(MonthDay varchar(20),                    Record_ID int not null auto_increment primary key);

declare rid INTEGER;

set rid = 0;

insert FirstDayOfMonths(MonthDay)select DATE_FORMAT(closed ,'%Y-%m-01') from ost_ticket otwhere closed between DATE_FORMAT(date_add(CURDATE(), interval -5 MONTH) ,'%Y-%m-01') AND LAST_DAY(CURDATE())group by DATE_FORMAT(closed ,'%Y-%m-01');

SELECT * FROM FirstDayOfMonths;

while 1=1begin   select FirstofMonth = MonthDay     ,pos = Record_ID  from FirstDayOfMonths  where rid < Record_ID  limit 1;

  if mysql_num_rows() = 0 leave;

end while

DROP TABLE FirstDayOfMonths;

 

And this is the error that I am getting.

 

declare rid INTEGER;[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'declare rid INTEGER' at line 1

Staff
1,598 Points
2017-08-24 6:27 pm
Hello!

Thanks for posting your comment regarding the MariaDB syntax error you are receiving. I recommend you review the way you are setting your variable's initial value. You can obtain more details and information regarding declaring variables with initial values from MariaDB's documentation. You may also find their documentation on User-defined Variables helpful in deciphering the correct syntax to use for your desired behavior. I hope this helps!

Sincerely,
Carlos E
n/a Points
2017-08-21 1:56 pm

Hi there, am having this error when am trying to update database records, any help would be appreciated.

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 ''users' set id = '0', phone = '08023855377', username = 'mo' at line 1

Regards,

Adeniyi

Staff
13,791 Points
2017-08-21 2:23 pm
We need to see your SQL query to help you troubleshoot this.
n/a Points
2017-07-31 2:22 am

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 2

here is my code

<?php

require 'database.php';

// create a variable

$name=$_POST['name'];

$company=$_POST['company'];

$email=$_POST['email'];

$telephone=$_POST['telephone'];

$type=$_POST['type'];

$budget=$_POST['budget'];

$objective=$_POST['objective'];

 

//Execute the query

 

mysqli_query($conn,"INSERT INTO contacts(name,company,email,telephone,type,budget,objective)

VALUES('$name','$company','$email','$telephone','$type','$budget',$objective')");

if( mysqli_affected_rows($conn)>0)

{

echo "<p>Data Added</p>";

//echo "<a href="/support/index.php">Go Back</a>";

}

else 

{

echo "Data NOT Added<br />";

echo mysqli_error ($conn);

}

 

?>

Staff
40,163 Points
2017-07-31 10:22 am
Hello Srushti,

Note that this article space is for the SQL errors, we don't troubleshoot your PHP code. If you look at the line with the error you'll notice that you have a double-quote close parentheses, but you don't have an open one anywhere - that's the syntax error. If you don't know how to use parentheses, then please consult the documentation or speak with an experienced database programmer.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
n/a Points
2017-07-26 7:09 am

please help me on this error

-- -- Dumping data for table `wp_options` -- INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload`) VALUES (1, 'siteurl', 'http://realfakedocs.com', 'yes'), (2, 'home', 'http://realfakedocs.com', 'yes'), (3, 'blogname', 'Real Fake Documents', 'yes'), (4, 'blogdescription', 'Just another WordPress site', 'yes'), (5, 'users_can_register', '0', 'yes'), (6, 'admin_email', ‘drakexxxwizard@gmail.com’, 'yes'), (7, 'start_of_week', '1', 'yes'), (8, 'use_balanceTags', '0', 'yes'), (9, 'use_smilies', '1', 'yes'), (10, 'require_name_email', '1', 'yes'), (11, 'comments_notify', '1', 'yes'), (12, 'posts_per_rss', '10', 'yes'), (13, 'rss_use_excerpt', '0', 'yes'), (14, 'mailserver_url', 'mail.example.com', 'yes'), (15, 'mailserver_login', 'login@example.com', 'yes'), (16, 'mailserver_pass', 'password', 'yes'), (17, 'mailserver_port', '110', 'yes'), (18, 'default_category', '1', 'yes'), (19, 'default_comment_status', 'open', 'yes'), (20, 'default_ping_status', 'open'[...]MySQL said: Documentation#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '@gmail.com’, 'yes'),(7, 'start_of_week', '1', 'yes'),(8, 'use_balanceTags', ' at line 11

Staff
40,163 Points
2017-07-26 7:51 am
Hello Drake,

We can't help with resolving an error message without looking at the MySQL code associated with the error. You may need to consult with an experienced database programmer if you are unable to resolve the coding issue. If you want us to look at it further, please provide the MySQL query associated with the error.

If you have any further questions, please let us know.

Kindest regards,
Arnel C.
n/a Points
2017-07-26 6:35 am

SQL query:

UPDATE user_table SET (country = 'india', state = 'westbengal', city = 'Kolkata', pincode = '700028', fulladdress = 'fgfgfg') WHERE email = 'wri@gmail.com'

 

MySQL said: 

#1064 - Erreur de syntaxe près de '(country = 'india', state = 'westbengal', city = 'Kolkata', pincode = '700028', ' à la ligne 1 

 

I get this error when I try to update my database. Please help. I am very new in php mysql.

Staff
40,163 Points
2017-07-26 7:47 am
Hello Writu,

Your error message is related to a syntax error in your code. You will need to review your code and look for where you have incorrectly written your MySQL query. You may need to review the MySQL documentation in order to obtain the correct syntax. You may also consider online MySQL parsers such as this one. They can help to identify the exact part of your code that is incorrect. If that doesn't help, then you should consult with an experienced database programmer.

If you have any further questions, please let us know.

Kindest regards,
Arnel C.
n/a Points
2017-07-15 11:52 pm

INSERT INTO playlists VALUES ('$nombre', $codigouser)

the error is: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')'

Staff
13,791 Points
2017-07-16 7:52 am
Make sure you close your SQL statement correctly.
n/a Points
2017-07-13 6:29 pm

How can I insert a string like '0.0.0.0' into a mysql table?

var = '0.0.0.0'

c.execute('INSERT INTO table VALUES (%s)'%(var))

gives me this error:

ProgrammingError: 1064 (42000): 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 '.0.0)' at line 1

Staff
40,163 Points
2017-07-14 8:44 am
Hello Anais,

You need to look at how you're defining the VAR. Please review this article from the MySQL website for further information.

If you have any further questions, please let us know.

Kindest regards,
Arnel C.
n/a Points
2017-07-11 8:19 am

I have trouble:

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'COUNT(kd_brg) as jml FROM t_sskel GROUP BY kd_brg, rph_aset) as t_sskel USING (k' at line 1

Staff
13,791 Points
2017-07-11 8:22 am
We need to see your SQL statement to see the error in the syntax. Please provide your SQL statement if you would like us to assist you further.
n/a Points
2017-07-09 10:54 am

Error

SQL query:

USE sharaf_xxx-- Adminer 4.2.4 MySQL dumpSET NAMES utf8;

When the database loads, the following error appears

 

 

 

Error

SQL query:

USE sharaf_XXX-- Adminer 4.2.4 MySQL dump

SET NAMES utf8;

 

 

MySQL said: Documentation

 

# 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 'SET NAMES utf8' at

 

Please help me

Staff
13,791 Points
2017-07-10 9:01 am
You may want to read through this on proper usage of set names:

http://php.net/manual/en/mysqlinfo.concepts.charset.php
n/a Points
2017-07-08 3:46 am

#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 'databases shop' at line 1

how to solve this error 

Staff
13,791 Points
2017-07-10 7:49 am
We need to see your SQL statement to troubleshoot this further.
n/a Points
2017-07-07 3:59 am

I m getting an error when try to add a store procedure :

 

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 'JSON), '$.platform') as platform,

      JSON_EXTRACT(CAST(s.chvScanData AS JSON)' at line 41

Staff
13,791 Points
2017-07-07 8:05 am
We need to see the entire query you are running. Can you provide it so we can assist you further?
n/a Points
2017-07-01 11:03 pm

I am getting an error at the time of importing database from localhost to live server for uploading wordpress website.

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to 

your MariaDB server version for the right syntax to use near '@', 1) LIMIT 1' at line 2

please fix this issue .

 

Staff
13,791 Points
2017-07-03 8:51 am
Without seeing the entire SQL statement being ran, we cannot troubleshoot this issue for you. Please respond with the entire SQL statement you are running.
n/a Points
2017-06-29 6:39 pm

I had this query  select * from department where deptID=303;

The issue ended up being that  * was pulling in the following fields, 

pid, name, deptID

Hence  name needed to be `name` and I had to spell out the field names. 

n/a Points
2017-06-16 9:49 am

Hello,

I try to upload a database to another hosting and I get this error:

 

5 Errors found during the Analysis.

 

1. Unexpected character (near "&" at position 462)

2. Unexpected statement start (near "" at position 0)

3. Unexpected statement start (near "" at position 3)

4. Unexpected statement start (near "&" at position 462)

5. Unexpected statement start (near "" at position 2155

 

Query SQL:

MySQL Message:

#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 'bzh41ay&sy?6r' at line 1

 

I'm INESPERABLE.

Thank you

Paul

Staff
2,858 Points
2017-06-16 12:07 pm
Paul, it sounds like you may have a corrupt copy of your SQL data. I would recommend trying again.
n/a Points
2017-05-25 12:51 am

$db->query("SELECT * FROM shows WHERE `BID`=$branchname  AND `HNO`=$hallno ;");

from the query above i got an error:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND `HNO`=' at line 2

Staff
30,194 Points
2017-05-25 11:11 am
Ensure the "branchname " variable is being filled with a valid value, as this is often what causes this type of error.

Thank you,
John-Paul
n/a Points
2017-05-20 8:31 pm

I am trying to upload from Blogger to Word Press.  I get this error:

CREATE DATABASE IF NOT EXISTS DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

MySQL said: Documentation

 

#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 'DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci' at line 1

Staff
43,761 Points
2017-05-22 1:19 pm
The beginning of your script says 'CREATE DATABASE IF NOT EXISTS' but does not name a database.
n/a Points
2017-05-18 11:25 pm

Oh geez, getting this erorr message when trying to access the "photo" section in the admin area of skadate 9.  Can anybody tell me how to fix this?

Uncaught exception with message: 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 '`skadate_tmp_photo' at line 1 code: 1064
Trace:
#0 /home/vol11_6/myhost.com/my_username/htdocs/home/admin/inc/fnc.config_photo.php(36): SK_MySQL::query('SELECT COUNT(*)...')
#1 /home/vol11_6/myhost.com/my_username/htdocs/home/admin/config_photo.php(131): UnProcessedPhoto()
#2 {main}

thrown in: /home/vol11_6/myhost.com/my_username/htdocs/home/internals/API/MySQL.class.php on line 169
Staff
2,858 Points
2017-05-19 11:50 am
Jeffro, you will need to review the actual query that is being attempted, and then check the scenarios above for potential solutions.
n/a Points
2017-05-12 11:57 pm

SQL query:

ALTER TABLE invoice

ADD NEW_TAX AS INV_TAX*1.20;

 

MySQL said:

***13:48:45ALTER TABLE invoice ADD NEW_TAX AS INV_TAX*1.20Error Code: 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 'AS INV_TAX*1.20' at line 20.000 sec***

 

Could you please tell me how to fix it?

 

Staff
43,761 Points
2017-05-15 11:26 am
You will need to check the syntax of your query. The proper form for adding a column is:

ALTER TABLE table_name
ADD column_name datatype;
n/a Points
2017-04-21 5:36 pm

Error

Static analysis:

6 errors were found during analysis.

 

  1. Unexpected character. (near "[" at position 57)
  2. Unexpected character. (near "]" at position 65)
  3. Unexpected character. (near "[" at position 67)
  4. Unexpected character. (near "]" at position 75)
  5. Unexpected character. (near "[" at position 77)
  6. Unexpected character. (near "]" at position 85)

 

SQL query:

INSERT INTO `username`(`id`, `username`, `hash`) VALUES ([value-1],[value-2],[value-3])

MySQL said: 

#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 '[value-1],[value-2],[value-3])' at line 1        why am I getting this please help???

Staff
2,858 Points
2017-04-21 6:09 pm
Burson, you need to place the values inside single quotes.
n/a Points
2017-04-05 6:50 pm

 $query = "INSERT INTO Users (`email`, `password`) VALUES ('".mysqli_real_escape_string($link, $_POST['email'])."', '".mysqli_real_escape_string($link, $_POST['password'])."')";

 

may i know whts wrong with this query?

it shows error

You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''email', 'password') VALUES('*******@gmail.coms' ,'dfgs')' at line 1CHIMENEAS

Staff
30,194 Points
2017-04-06 1:14 pm
It looks like you have some unnecessary quotation marks (") in your statement. Here is a helpful link to information on the SQL INSERT INTO Statement where they provide working examples.

Thank you,
John-Paul
n/a Points
2017-03-16 6:37 pm

When building a schema with the data below I get an error message - The description was initially blank - I filled it with Null and what is there now. 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 'Resource (`ar_id` int, `activity_id` int, `resource_id` int, `description` v' at line 1

CREATE TABLE Activity Resource
   (`ar_id` int, `activity_id` int, `resource_id` int, `description` varchar(4), `plan_quantity` int)
;

INSERT INTO Activity Resource
  (`ar_id`, `activity_id`, `resource_id`, `description`, `plan_quantity`)
VALUES
    (9, 8, 3, 'description', 40),
    (10, 9, 3, 'description', 40),
    (8, 7, 4, 'description', 40),
    (11, 9, 4, 'description', 40),
    (25, 28, 10, 'description', 86),
    (26, 14, 12, 'description', 5),
    (27, 17, 12, 'description', 5),
    (28, 18, 12, 'description', 15),
    (29, 15, 12, 'description', 5),
    (30, 16, 12, 'description', 20)
;
Staff
2,858 Points
2017-03-17 12:41 pm
JD, if you are attempting to create a MySQL table that has spaces in its name, you will need to place it in backtick marks. Like `Activity Resource`
n/a Points
2017-03-01 9:20 am

Thank your for sharing. Best explanation for MySQL. I got an error for eaysocial extension as:

 

1064

YOU HAVE AN ERROR ?N YOUR SQL SYNTAX; CHECK THE MANUAL THAT CORRESPONDS TO YOUR MYSQL SERVER VERS?ON FOR THE R?GHT SYNTAX TO USE NEAR 'OR `A`.`?D` NOT IN (SELECT `CATEGORY_?D` FROM `BLUE_SOC?AL_CLUSTERS_CATEGOR?ES_A' AT L?NE 1 SQL=SELECT DISTINCT `A`.* FROM `BLUE_SOC?AL_CLUSTERS_CATEGOR?ES` AS `A` LEFT JOIN `BLUE_SOC?AL_CLUSTERS_CATEGOR?ES_ACCESS` AS `B` ON `A`.`?D` = `B`.`CATEGORY_?D` WHERE `A`.`TYPE` = 'EVENT' AND `A`.`STATE` = '1' AND (`B`.`PROF?LE_?D` = OR `A`.`?D` NOT IN (SELECT `CATEGORY_?D` FROM `BLUE_SOC?AL_CLUSTERS_CATEGOR?ES_ACCESS`)) ORDER BY `A`.`ORDER?NG`

Staff
40,163 Points
2017-03-01 4:12 pm
Hello Proweblabs,

We looked at your query and the error appears in this section of the code:

(`B`.`PROF?LE_?D` =

After the equal sign, there is no value set. Speake with a developer/programmer of the extension.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
n/a Points
2017-02-19 1:32 pm

 I got error - 1064 Check sql syntax near %f trying the code below. I used the db world provided with MYsql Workbench. In Connector/Python, I was trying  to create a cursor that enables execution of prepared statements. 

Thanks in advance, 

cnx = mysql.connector.connect(**config)

cursor = cnx.cursor(prepared=True) 

 

query = """

SELECT Name, Continent, Region, Population

FROM country AS s

WHERE s.Continent = %s  AND s.LifeExpectancy > %f"""

cursor.execute(query, ('Europe', 50, ))

 cursor.execute(query, (Africa, 40))

# print ("Countries in :", Continent)

 

for row in cursor:

print("* {Name}:  {Continent}: {Region}: {Population}".format(**row))

 

Staff
2,858 Points
2017-02-20 6:33 pm
Yobel, it sounds like the 'variable' %f is not being populated properly. What value is this variable supposed to contain?
2017-02-17 5:01 pm
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 '7,12,30,14,10,6,4,11,13,15,) AND s.login_type NOT IN (1)' at line 2


I also don't know where to place the correct fix in my IPBoard to solve this issue

please help!
Staff
2,858 Points
2017-02-17 5:10 pm
Kus, it looks like your code is trying to find something in '1', but is unable to do so. This may be due to a variable being improperly set, but we really recommend reviewing this with an experienced web developer.
n/a Points
2017-02-09 6:22 am

I have #1064 error in this line please help

 mysql_query("update student set Name='$_POST[t3]',Address='$_POST[ta]',Class='$_POST[t5]', Div='$_POST[t6]',Gender='$_POST[t7]',Email='$_POST[t8]',Phone='$_POST[t9]',Guardian='$_POST[t10]','Guardian Phone'='$_POST[t11]' where 'Reg no'='$_POST[t2]'");

Staff
30,194 Points
2017-02-09 1:35 pm
What is the full 1064 error you are getting? For example, it typically will state which line the error is occurring on.

Thank you,
John-Paul
n/a Points
2017-02-03 11:45 pm

What do I do?

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 ') LIMIT 5' at line 1 *** SQL *** SELECT `name`, series_id FROM manga_series where total_chapters > 0 AND is_online = 1 AND series_id>4483 AND series_id NOT IN () LIMIT 5

Staff
43,761 Points
2017-02-06 10:08 am
The error is in the 'series_id NOT IN () ' section. There needs to be at least one item in the list, for NOT IN otherwise that part of the statement is not needed.
n/a Points
2017-02-03 7:44 am

PHP Fatal error:  Uncaught exception 'ErrorException' with message 'Error: 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

'ASC DESC LIMIT 0,15' at line 1

Error No: 1064

SELECT o.order_id, o.date_added, od.order_download_id, od.name, od.filename, od.remaining FROM ocfx_order_download od LEFT JOIN `ocfx_order` o ON (od.order_id = o.order_id) WHERE o.customer_id = '4' AND o.order_status_id > '0' AND o.order_status_id = '5' AND od.remaining > 0 ORDER BY ASC DESC LIMIT 0,15' in /home/cooki822/public_html/vqmod/vqcache/vq2-system_database_mysqli.php:41

This is the error message (this happens when someone buys a downloadable

product and tries to find it in his account (in downloads)(he will see a blank screen).

Do you need any more info to help you identify the problem and help me?

Staff
2,858 Points
2017-02-03 12:00 pm
George, you will want to work with an experienced web developer, if you don't have one already, to assist you in resolving this issue.
n/a Points
2017-01-29 1:50 pm

how to fix this 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 'Osclass 3.7.1 2016-12-27 ------------------------ - Fixed URL params error - Bl' at line 1

Osclass 3.7.1 2016-12-27

------------------------

 

- Fixed URL params error

- Blocked upgrade on demo sites

- Fixed some minor details

 

Osclass 3.7.0 2016-12-12

------------------------

 

- Multisite fixes and improvements

 

Staff
43,761 Points
2017-01-30 4:08 pm
You are not using a SQL Query.
n/a Points
2017-01-22 4:52 am

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

 

please help me

Staff
43,761 Points
2017-01-23 6:16 pm
That's a tough one, especially without having the query that is being executed. Try going through all the scenarios above and see if any of those fit your situation.
n/a Points
2017-01-18 6:37 am

Please I have this error:

SQL query:

 

 phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 18, 2017 at 09:46 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12

MySQL said:

#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 'phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Host: 1' at line 1

 

 

please help me..I am new to this kind of  problem.

Staff
40,163 Points
2017-01-19 3:00 am
Hello Aksa,

Sorry for the problem with your SQL syntax. In order to help you, we would need to see the MySQL code where the error is happening. Please provide the code and we can investigate it for you.

If you have any further questions, please let us know.

Kindest regards,
Arnel C.
n/a Points
2017-01-12 9:44 am

DELIMITER $$ 

CREATE TRIGGER `ev_dw`.`THEME_CHANGE` BEFORE UPDATE ON `ev_dw`.<`lookup_ev_theme`>

    FOR EACH ROW BEGIN

UPDATE TABLE `ctrl_ev_app`

SET THEME=app_theme

WHERE NEW.id=ctrl_ev_app.maid

    END$$

 

DELIMITER ;

getting error in line 1

Error Code: 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 '<`lookup_ev_theme`>

    FOR EACH ROW BEGIN

UPDATE TABLE `ctrl_ev_app`

SET THEME=' at line 1

Staff
30,194 Points
2017-01-12 1:46 pm
This looks to be caused by the syntax on the following line:
`ev_dw`.<`lookup_ev_theme`>


I recommend reviewing the syntax there. Here is a helpful link to the documentation for the CREATE TRIGGER Syntax.

Thank you,
John-Paul
n/a Points
2017-01-04 6:56 pm

We're migrating our website from another hosting provider. And every time I try to upload the bzip file, this is the error I get. I am not very knowledgeable with php and SQL, so I have no idea what it means, where to find the problem and how to fix it.

There is a chance that you may have found a bug in the SQL parser. Please examine your query closely, and check that the quotes are correct and not mis-matched. Other possible failure causes may be that you are uploading a file with binary outside of a quoted text area. You can also try your query on the MySQL command line interface. The MySQL server error output below, if there is any, may also help you in diagnosing the problem. If you still have problems or if the parser fails where the command line interface succeeds, please reduce your SQL query input to the single query that causes problems, and submit a bug report with the data chunk in the CUT section below:----BEGIN CUT----eNolzT0KAjEUBOD+nWIOEEISs4rpwhJW4eXHZLWwE7Gw2U7Qk3k9o8J08zETas3VYdQYDTgkB62hDTbDltrcmzdRfLUDOwxyLVeWjq0iNwE/hTQLnEJH8XJFzOc9s+9MUYnewUoldY+lsitfJ3L7rxgFvi+PJ7FPk8Ntod/BBxlSIYo=----END CUT--------BEGIN RAW----

ERROR: C1 C2 LEN: 11 12 759
STR: ?

MySQL: 5.6.34
USR OS, AGENT, VER: Mac MOZILLA 5.0
PMA: 4.0.10.14
PHP VER,OS: 5.6.20 Linux
LANG: en
SQL: 

----END RAW----

SQL query:

 

 

 

MySQL said:

#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 'BZh41AY&SY??' at line 1

Staff
40,163 Points
2017-01-04 8:09 pm
Hello Melissa,

Sorry for the problem with your MySQL error. The error you're seeing appears to be trying to process that encoded file as a MySQL query. The error you're seeing is showing data that is NOT SQL code. This is causing the error to appear. If you were working with a compressed file, make sure you expand (uncompress) the file before processing it as a MySQL file. Your expanded file should be a file typically ending in the .SQL extension.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
n/a Points
2016-11-30 12:00 pm

Hello, 

Below is my stored function code and I'm getting this error "Error Code:1064. You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '=rate*amount; return(interestResult); END' at line 5. 

 

DELIMITER $$

CREATE FUNCTION interest_amount(rate double, amount double)

RETURNS DOUBLE

BEGIN

DECLARE result DOUBLE;

result=rate*amount; #getting error on this line,red line under the word "result"

RETURN (result);

END$$

DELIMITER ;

Staff
40,163 Points
2016-11-30 12:31 pm
Hello Kanvi,

The problem you are having is related to the syntax of your equation. You would not be using that syntax for the equation in MySQL. Here's an example of adding an equation in MySQL.

If you have any further questions or comments, please let us know.

Regards,
Arnel C.
n/a Points
2016-11-26 11:39 am

my code: 

CREATE TABLE 'test'.'sensor' (

 

'id' INT NOT NULL AUTO_INCREMENT PRIMARY KEY,

'time' TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,

'value' VARCHAR( 10 ) NOT NULL)

I'm getting error in mysql as:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''test'.'sensor' ('id' INT NOT NULL AUTO_INCREMENT PRIMARY KEY,'time' TIMES' at line 1

Staff
43,761 Points
2016-11-28 3:06 pm
The error seems to be due to the single quote usage. You may want to try either removing them altogether or using backticks instead.
n/a Points
2016-11-26 2:51 am

Hi, I have got this 1064 Error continuously when trying to browse rows data available in my table : 

 #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 '50.' at line 2

SELECT * FROM `exorti_store` LIMIT 0 , 50.

note: table is showing data correctly when passing other queries 

so please help me how to fix this.

 

 

Staff
43,761 Points
2016-11-28 2:57 pm
If you wish to limit the results to 50, you do not need the 0 in front of it. Just set "LIMIT 50"
n/a Points
2017-05-11 11:30 am
"select appareils.id_appareils, appareils.prix_appareils, type_appareil.description_type_appareil, marque.nom_marque FROM (appareils INNER JOIN type_appareil ON appareils.code_type_appareil = type_appareil.id_type_appareil AND INNER JOIN marque ON appareils.code_marque=marque.id_marque)" error in the syntax .. please help me
Staff
30,194 Points
2017-05-11 1:00 pm
I recommend reviewing your syntax for the "Select" statement. Here is a helpful guide that provides successful example of the SQL Select Statement.

Thank you,
John-Paul

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

783 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!