473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

use of reserved words in MySQL

190 100+
i am getting SQL syntax mistake in PHP can you tell me why ?

my code is [PHP]echo $sql = "insert into cont_event(cont_code , event_name, date, subject, remarks, repeat) values('$cont', '$eve_name', CURDATE(), '$sub', '$msg', '$repeat')";[/PHP] and error i m getting is

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 'repeat) values('17' ,'gjhgjhg' , CURDATE(), 'fgdgfdg', 'fdgfdfdg
Apr 16 '08 #1
3 2292
amitpatel66
2,367 Expert 2GB
i am getting SQL syntax mistake in PHP can you tell me why ?


my code is

[PHP]echo $sql = "insert into cont_event(cont_code , event_name, date, subject, remarks, repeat) values('$cont', '$eve_name', CURDATE(), '$sub', '$msg', '$repeat')";[/PHP]



and error i m getting is


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 'repeat) values('17' ,'gjhgjhg' , CURDATE(), 'fgdgfdg', 'fdgfdfdg
Try printing $sql on the screen and check if the query that is formed is of perfect syntax.

Could you please post the output of $sql after the values being substituted for all the variables for reference.
Apr 16 '08 #2
Shalini Bhalla
190 100+
Thanks alot , but i have found it i used 'repeat' as a field name which is a key word ao , i have corrected it and now it is working
Apr 16 '08 #3
ronverdonk
4,258 Expert 4TB
Yes: repeat is one of a number of reserved words in MySQL. A list (version 5) can be found in chapter Reserved words in the MySQL documentation.

Please use a more meaningful title next time you open a thread.
You cannot call "Pls Tell My mistake I'm stucked ..." a really 'say-it-all' title that attracts many members to have a look.

Ronald
Apr 16 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Peter Engström | last post by:
Hi! I'm running MySQL 4.0.13 and have problem with fulltext search. I have a column of type 'text' which I fulltext index. I want to search for an e-mail address but I don't get any matches....
2
by: Matthew Cascio | last post by:
My understanding is that using reserved words as column names is allowable as long as they are quoted. I am trying to create a table dynamically with columns defined by the first row of a text...
1
by: JFB | last post by:
Hi All, Does anybody know if it is a list of reserved words that vb.net use? Tks in advance JFB
7
by: Stephen Howard | last post by:
I've got a moderately complex function defined which i then want to be able to test the value of, as well as select the value: select id, vector_cosine(document,'') as threshold from...
3
by: VK | last post by:
Just to realease my frustration: innocent "enum" is a reserved word in JScript! !@#$%^&* I occasionally discovered it just before I got ready to smash my computer over my head (some people...
31
by: metaperl | last post by:
-- python -i File "<stdin>", line 1 class = "algebra" ^ SyntaxError: invalid syntax Why isn' t the parser smart enough to see that class followed by an identifier is used for class...
3
by: Robert | last post by:
I ask because, in Access help, it does not list is as such, however, I had a table with a field named 'Name'. If I put a control on a form and used this as the control source no problems, but if I...
8
by: Tim H | last post by:
I know C's rules about reserved identifiers (anything starting with "_", leading "is", etc). I don't know C++ rules. I assume the same rules and more apply? I've seen several conventions for...
0
missinglinq
by: missinglinq | last post by:
When naming controls and variables in Access you should always be careful not to use Access Reserved Words! If you have to give them a similar name, use something like txtDate, or even better,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.