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
3 2292
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.
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
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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....
|
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...
|
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
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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,...
| |