Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 8th, 2006, 10:25 PM   #1
Chris Weimer
Programmer
 
Join Date: May 2005
Posts: 34
Rep Power: 0 Chris Weimer is on a distinguished road
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?
Chris Weimer is offline   Reply With Quote
Old May 8th, 2006, 11:14 PM   #2
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 873
Rep Power: 4 The Dark is on a distinguished road
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
( ... )
The Dark is offline   Reply With Quote
Old May 9th, 2006, 9:30 AM   #3
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old May 9th, 2006, 1:40 PM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
You're also using the wrong quote marks. ' is used for data; ` is used for table/column/database names.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 9th, 2006, 8:30 PM   #5
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 873
Rep Power: 4 The Dark is on a distinguished road
Quote:
Originally Posted by Ooble
You're also using the wrong quote marks. ' is used for data; ` is used for table/column/database names.
Umm, they are column names.
The Dark is offline   Reply With Quote
Old May 10th, 2006, 9:38 AM   #6
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Ah, whoops. Must read...
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jun 9th, 2006, 1:10 AM   #7
splinter9x
Hobbyist Programmer
 
splinter9x's Avatar
 
Join Date: Jun 2006
Posts: 137
Rep Power: 0 splinter9x is an unknown quantity at this point
Reading is good... Look DaWei another person who cant read. :eek:
__________________
Visit my Blog
I support WINDOWS...
splinter9x is offline   Reply With Quote
Old Jun 9th, 2006, 9:42 AM   #8
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Please stop reviving dead threads.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Jun 9th, 2006, 6:02 PM   #9
splinter9x
Hobbyist Programmer
 
splinter9x's Avatar
 
Join Date: Jun 2006
Posts: 137
Rep Power: 0 splinter9x is an unknown quantity at this point
Sorry didn't know it was dead.....
__________________
Visit my Blog
I support WINDOWS...
splinter9x is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:48 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC