Hi all,
I keep receiving an error with the following code. I am trying to make a function that will format a field (content=0.0032) into a varchar/percent (content=0.32%). At the moment i'm just trying to get format to work, and it throws up an error
"Error Code : 1064
You have an error in your SQL syntax; check the manual that corres...
Any idea why this is popping up :( ?
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 'CREATE TABLE `clocks` ( `id` int(11) NOT NULL AUTO_INCREMENT, ' at line 6
** Here is the query **
CREATE TABLE `clients` (
`id` int(11) N...
Do you have any idea why i get this:
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 '``, `title` varchar(255) collate latin1_general_ci NOT NULL default ``,' at line 3
The code is like this (the part im having problem with...)
$sql = 'CREATE TABLE ...
I'm trying to execute this simple command:
create table foo
(clo int primary key unsigned auto_increment);
But I get this 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 'unsigned auto_increment)' at
line 2
...
I have a .sql file with some database backups inside. Now I want to restore them back to MySQL. How can I this using command line of MySqL please? I found this:
mysql -u username -p -h localhost database_name < dumpfile.sql
but I don't know what username should be, what database_name should be and how I could browse to a .sql file ...
Query:
select t1.col1
from table1 t1
inner join with (nolock) table2 t2 on t1.col2 = t2.col1
Am trying to use nolock option for optimized query in mySQL db, but for some reason the above query
does not work and the error i receive is
You have an error in your SQL syntax;
Any thoughts?
...
here's what the statement looks like:
DELETE FROM videoswatched vw2
WHERE vw2.userID IN ( SELECT vw.userID
FROM videoswatched vw
JOIN users u ON vw.userID=u.userID
WHERE u.companyID = 1000
GROUP BY userID )
that looks decent to me, and th...
I would like to construct a query that fetches results that occurred between NOW and 15 minutes ago, im getting a mysql error when I try the following , can you help me? thanks
SELECT *
WHERE user_id = '000'
AND date_time < now( )
AND date_time > DATE_SUB( now( ) , INTERVAL 15 MINUTE)
Error message:
You have an error in yo...
Hi there,
I am trying to insert a lot of fields into a MySQL database, some are failing, so I am adding some code into my PHP script to try and track down what is occurring.
The replace seems to work as I can see the fields being populated in mysql, but I get this error:
1064:You have an error in your SQL
syntax; check the manual...
Hi there,
I have a problem in sql query execution.I am using this sql query:
$userid = 1;
$sql = mysql_query("
SELECT ID, Nm, Address, date_format(DateOfBirth, '%d%M%Y') as DateOfBirth
FROM PersonalDetails where UserMasterID = $userid
") or die (mysql_error());
The result appears as:
You have an error in your SQL syntax; che...
I want to add mysql function:
CREATE FUNCTION `chf_get_translation`(translation_id INT, site_lang INT)
RETURNS text CHARSET utf8
BEGIN
DECLARE translation TEXT;
SELECT title
INTO translation
FROM chf_translations
WHERE key_id = translation_id
AND lang_id = site_lang;
RETURN translation;
END
But get error...
SELECT @cnt := COUNT(table_name)
FROM information_schema.tables
WHERE table_schema = 'TAA'
and table_name = 'Clients';
IF (@cnt > 0) THEN
INSERT INTO `ClientsBAK` SELECT * FROM `Clients`;
END IF;
I get a syntax error at IF(@cnt > 1) THEN error 1064
...
Hi everybody,
I have this query:
SELECT `manufacturers`.*, `languages`.*, COUNT(`products`.`id`) AS productcount
FROM (`manufacturers`)
WHERE `manufacturers`.`flushed` = `0`
JOIN `languages` ON `manufacturers`.`lang` = `languages`.`id`
LEFT OUTER JOIN `products` ON
`products`.`manuf` = `manufacturers`.`mid`
GROUP BY manufacturers.i...
Hi, when trying to create a simple procedure in mysql 5.1.47-community it fails everytime i've tried everything!
even simple things like this!
DELIMITER //
CREATE PROCEDURE two ()
begin
SELECT 1+1;
end;
//
The error is
ERROR: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server v...
Hi, the following query
CREATE TABLE IF NOT EXISTS XY (
x INT NOT NULL ,
y FLOAT NULL ,
PRIMARY KEY(x)
)
INSERT INTO XY (x,y)
(select 1 as x ,(1/7) as y);
errors with
Error code 1064, SQL state 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 ne...
Can someone please help as i've spent all day trying to fix this. I installed the latest XAMPP and now i can't connect to mysql from terminal.I checked my .profile file and the PATH seems ok. Does anyone know whats happened and what's the solution?
PATH=$PATH:/Applications/XAMPP/xamppfiles/bin
export PATH
THIS IS A PROGRAMMING QUESTION...
Hi folks!
I'm trying to use temp tables to speed up my MySQL 4.1.22-standard database and what seems like a simple operation is causing me all kinds of issues.
My code is below....
CREATE TEMPORARY TABLE nonDerivativeTransaction_temp (
accession_number varchar(30),
transactionDateValue date)
) TYPE=HEAP;
INSERT INTO nonDerivativ...
I´m trying to create a trigger on MySQL but I´m having a syntax problem, which I was not able to find. If someone more experience could help me it would be great (it´s the first time I use MySQL!)...
The reason why I´m creating this trigger is for deleting all the orphan "labels", which has a many-to-many relation with "service_descript...
This code worked in Sqlite which i have more experience with. I cant figure out whats wrong here. If it helps SELECT 1 FROM Post WHERE body = 'a'; doesnt give me a syntax error but this does
select 1 WHERE NOT EXISTS (SELECT 1 FROM Post WHERE body = 'a' ) ;
code:
INSERT INTO `Post` (
`name`,
...
`date`) select
@0,
...
@6 WHERE NOT ...
Code:
for($i = 1; $i <= $arr['var']; $i++) {
if($i == $arr['var']):
$insert .= '('.$n_id.', 12)';
else:
$insert .= '('.$n_id.', 12),';
endif;
}
$uz = mysql_query("INSERT INTO `cars`
(n_id, auto_id)
VALUES
'$insert'") or die(mysql_error());
Why it gives me a ...