![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: May 2005
Posts: 34
Rep Power: 0
![]() |
MySQL Problem
Hello folks,
I'm having a bit of trouble using phpMyAdmin, and was wondering if anyone knew what was wrong. I lost some information, but luckily I had a backup two weeks earlier. This is the error message: #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 'INSERT INTO `smf_messages`
(`ID_MSG`, `ID_TOPIC`, `ID_BOARD`,This is the line its talking about: INSERT INTO `smf_messages` ( `ID_MSG` , `ID_TOPIC` , `ID_BOARD` , `posterTime` , `ID_MEMBER` , `subject` , `posterName` , `posterEmail` , `posterIP` , `smileysEnabled` , `modifiedTime` , `modifiedName` , `body` , `icon` ) Anyone see a problem? |
|
|
|
|
|
#2 |
|
Expert Programmer
Join Date: Jun 2005
Posts: 816
Rep Power: 4
![]() |
Don't you need to say what values you are putting in?
i.e. INSERT INTO `smf_messages` ( `ID_MSG` , `ID_TOPIC` , `ID_BOARD` , `posterTime` , `ID_MEMBER` , `subject` , `posterName` , `posterEmail` , `posterIP` , `smileysEnabled` , `modifiedTime` , `modifiedName` , `body` , `icon` ) VALUES ( ... ) |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
Yep, missing the "VALUES"...
Say for instance, I have a table named myTable with fields of: ID and NAME. Also, since I have values for all fields in my table, there is no need to specify the columns ahead of time. To insert into the table, I would execute this: INSERT into myTable VALUES ('0001','Infinite Recursion'); COMMIT; Where "0001" is the ID and "Infinite Recursion" is the NAME.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
You're also using the wrong quote marks. ' is used for data; ` is used for table/column/database names.
|
|
|
|
|
|
#5 | |
|
Expert Programmer
Join Date: Jun 2005
Posts: 816
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
|
|
#6 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Ah, whoops. Must read...
|
|
|
|
|
|
#7 |
|
Hobbyist Programmer
Join Date: Jun 2006
Posts: 137
Rep Power: 0
![]() |
Reading is good... Look DaWei another person who cant read. :eek:
![]() |
|
|
|
|
|
#8 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Please stop reviving dead threads.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|