mysql-error-1064

MYSQL ERROR 1064 (42000) - error in SQL syntax

I'm importing some entries into a MYSQL table and it breaks on one of the INSERT statements with the following error: 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 'reqSent', 'Your 1-on-1 Request has been sent', '& (3996, 'reqSent...

Delete all record exist in all table.

Hello there, How to make query in sql to delete all record exist in every table. There possible to write every name table using command delete. But it will take long time to write every single name table. I am already try DELETE FROM * in MySQL but it got error: You have an error in your SQL syntax; check the manual that correspond...

Declaring and using MySQL varchar variables

I'm trying to do some simple manipulations with variables in MySQL 5.0 but I can't quite get it to work. I've seen many (very!) different syntaxen for DECLARE/SET, I'm not sure why... in any case I'm presumably confusing them/picking the wrong one/mixing them. Here's a minimal fragment that fails: DECLARE FOO varchar(7); DECLARE oldFO...

SQL Query Error

What is wrong with this Query? INSERT INTO Registration (`Status`, `String`) VALUES ('Confirmed', '0') WHERE `String` = '". mysql_real_escape_string($user) ."' 1A: UPDATE Registration `Status` = 'Confirmed', `String` = '0' WHERE `String` = '". mysql_real_escape_string($user) ."' ...

How to get scalar result from prepared statement?

Is it possible to set the result from a prepared statement into a variable? I am trying to create the following stored procedure but it is failing: ERROR 1064 (42000) at line 31: 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 'stmt USING @m, @c, @...

2nd PDO exec get MySQL Syntax error or access violation: 1064

Hello! I am new here. The code and error below I try to solve in three days. Could anyone help me? $db = new PDO('mysql:dbname=' . DBNAME . ';host=' . DBHOST, DBUSER, DBPASS, array(PDO::ATTR_PERSISTENT => true)); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->exec("INSERT INTO A (phone, city, address) VALUES ('12345...

Query between federated tables and local tables

Hy, I have problems with Mysql query's made between few federated tables and local tables. With multiple joins in querys and inserts that are using one or two federated tables with two or three local tables results in time-out .... How can this problem be resolved?Where is the problem? Is not recomended? If not what is the best way to...

How can I create a TABLE if and only if it does not exist?

I'm trying conn = MySQLdb.connect (host = "localhost", user = "username", passwd = "password", db = "my_db") cursor = conn.cursor () q = """IF NOT EXISTS CREATE TABLE %s ( course VARCHAR(15), student VARCHAR(15), teacher VARCHA...

MySql calling stored function from within a stored procedure causing error

I'm getting a 1064 error when trying to call a stored function from within a stored procedure. It only happens on the line where I try to do this: SET account_id = get_account_id(user);. What is the problem and how can I fix it? Account ID Stored Functions: CREATE DEFINER=`aaron`@`%` FUNCTION `get_account_id`(user VARCHAR(255)) RETUR...

How to deal with Apostrophe while writing into Mysql database

I am getting this 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 's','portal','','offering','MSNBC','News','','sports','','MSN','Money','','games'' at line 3 The only problem is that this error shows up when inserting data that contains a...