mysql LOAD DATA INTOFILE ERROR 1064 42000 error line 1 - mysql

I'm trying this and for some reason is not working.
I'm suspecting it may be the - but not totally sure.
I have read the mysql manual but does not say how to scape or what exactly this error is about, I mean it does but is confusing..
mysql> LOAD DATA INFILE 'meow-ever.txt' INTO TABLE meow-ever
-> ;
ERROR 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 '-ever' at line 1

You must escape your table name, like that :
LOAD DATA INFILE 'meow-ever.txt' INTO TABLE `meow-eve`
Notice it's not regular quote, I don't remember how you can type it on a qwerty keyboard sorry :)

Related

web application got a error mysql query

select b1.blog_id, blog_name, blog_desc, b1.blog_date, blog_author, blog_img, ifnull(count(blog_cmt),0) AS blog_cmt
from blog b1, user_blog b2"
I got a error in this:
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 '"' at line 1
Error #1064 means that MySQL can't understand your command. To fix it:
Read the error message. It tells you exactly where in your command
MySQL got confused.
Check the manual. By comparing against what MySQL
expected at that point, the problem is often obvious.
Check for reserved words. If the error occurred on an object identifier, check
that it isn't a reserved word (and, if it is, ensure that it's
properly quoted).
You need to remove the quotes at the end and run your query. Looks like there is a typo, you intended a ; instead.
select b1.blog_id, blog_name, blog_desc, b1.blog_date, blog_author, blog_img, ifnull(count(blog_cmt),0) AS blog_cmt
from blog b1, user_blog b2;

Learning IN values

I'm trying to do a IN values statement. This is my query:
I did mysql_escape_string on each of the elements in the IN so mysql_escape_string('http://www.blah.com/%s') gave me http://www.blah.com/%s
SELECT * FROM social_handlers WHERE (`group` = 0 OR `url_template` IN ("http://www.blah.com/%s", "totally bogus val")) AND update_time > 0
It keeps telling me this error though:
MySQL 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 'url_template IN ("http://www.blah.com/%s", "totally bogus val")) AND update_ti' at line 1
How can I identify this error?
This is my social_handlers table:
I also had to do mysql_set_charset('utf8',$connectid); because i support Russian and Chinese characters.

why does simple update query in mysql keeps giving error code 1064?

This is the query:
update table tblprobleem set omschrijving='bugfixes' where probleem_id=4;
I checked omschrijving, its datatype is varchar. probleem_id is integer. I tried to rewrite it a thousand times, I just don't get what is wrong with this.
error message:
12:03:05 update table tblprobleem set omschrijving='bugfixes' where
probleem_id=4
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 'table tblprobleem set omschrijving='bugfixes'
where probleem_id=4' at line 1 0.000 sec
If anybody has the answer, you have my thanks forevere.
Greetz,
John
remove the table in your query make it like this
update tblprobleem set omschrijving='bugfixes' where probleem_id=4

sql syntax error storing html table as text in mysql

Query to insert text in database is:
INSERT INTO uri VALUES('')
I'm getting follwing Syntax error:
MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll
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 'liq" style="font-size:110%;font-family:'Alvi Nastaleeq', 'Nafees Nastaleeq', 'Na' at line 1
change this
title=\"Nasta'liq\"
^-----you have single quote alone here .get rid of it
to
title=\"Nasta liq\"
or
title=\"Nastaliq\"

load SQL and ignore duplicates

I want to import an SQL file using PHPMyAdmin where I know duplicates exist. I am using the syntax:
LOAD DATA INFILE 'C:\Documents and Settings\...\db_settings_extends.sql' ignore;
I receive the 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 '' at line 1
How do I correct this?
From the error message, it looks like duplicates are not the problem. It seems to not like your string value or something next to it.