Current location: Hot Scripts Forums » Programming Languages » PHP » What is wrong with this!?!


What is wrong with this!?!

Reply
  #1 (permalink)  
Old 11-13-09, 04:42 AM
marsters256 marsters256 is offline
New Member
 
Join Date: Nov 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
What is wrong with this!?!

Over an hour now I'm starting to go mad...

INSERT INTO union (AutoID, first_name, organisation, post_code, email, contact, resident, parliament, alphabeta, courage, Regdate) VALUES ('', 'ben', 'bencorp', 'cty12ld', 'will@hot.com', 'address12321', '1', 'bush', '0', '4', '12')




#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 'union (AutoID, first_name, organisation, post_code, email, contact, resident, pa' at line 1

gaaaaah please help
Reply With Quote
  #2 (permalink)  
Old 11-13-09, 06:27 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
I think you may be running into trouble by using "UNION" for a table name.

"UNION" is a reserved word, so if you're going use it as a table name (not really a good idea) then you'll need to put backticks (`) around it.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
  #3 (permalink)  
Old 11-13-09, 07:01 AM
hon33y hon33y is offline
New Member
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
UNION is a key word. try this.

INSERT INTO [union] (AutoID, first_name, organisation, post_code, email, contact, resident, parliament, alphabeta, courage, Regdate) VALUES ('', 'ben', 'bencorp', 'cty12ld', 'will@hot.com', 'address12321', '1', 'bush', '0', '4', '12')
Reply With Quote
  #4 (permalink)  
Old 11-13-09, 08:52 PM
Jcbones Jcbones is offline
Aspiring Coder
 
Join Date: Mar 2009
Location: North Carolina, USA
Posts: 516
Thanks: 5
Thanked 47 Times in 44 Posts
or this
PHP Code:

INSERT INTO `union` (AutoIDfirst_nameorganisationpost_codeemailcontactresidentparliamentalphabetacourageRegdateVALUES ('''ben''bencorp''cty12ld''will@hot.com''address12321''1''bush''0''4''12'
Reply With Quote
  #5 (permalink)  
Old 11-14-09, 11:02 AM
marsters256 marsters256 is offline
New Member
 
Join Date: Nov 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
omg

Omg lol I'll give that a try and get back to you.

Who knew?

well... you guys obvisously... but not me...
Reply With Quote
  #6 (permalink)  
Old 11-14-09, 11:11 AM
marsters256 marsters256 is offline
New Member
 
Join Date: Nov 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
yes it worked thankyou very much.
Reply With Quote
Reply

Bookmarks


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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
what have I done wrong? php attachments for mail moe180 PHP 0 06-10-09 08:14 AM
Warning: Wrong parameter count... Tim Mousel PHP 5 01-23-06 12:10 PM


All times are GMT -5. The time now is 08:04 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.