If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Table insertion not working...!!!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-16-10, 14:51
nusry nusry is offline
Registered User
 
Join Date: Feb 2010
Posts: 7
Red face Table insertion not working...!!!

guys.. I hv created a table called "user" for logging purpose.. which has user_id, user_name,user_password and user_Type fields.. I've set user_id to auto increment..

after tht I've try to insert a record via sql window located in phpmyadmin.. I've try to insert the record by giving following query..

INSERT INTO user(user_name,user_password,user_type)
VALUES (smith,smith123,str)

but it has returned a error message like this.

#1054 - Unknown column 'smith' in 'field list'

so wht's wrong with my query... please help me..
Reply With Quote
  #2 (permalink)  
Old 03-16-10, 16:23
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,517
Quote:
Originally Posted by nusry View Post
INSERT INTO user(user_name,user_password,user_type)
VALUES (smith,smith123,str)

but it has returned a error message like this.

#1054 - Unknown column 'smith' in 'field list'
Shouldn't smith be in quotes?
Not sure if str is a variable or a string - if it's a string then it should be in quotes also.
__________________
Mike
Reply With Quote
  #3 (permalink)  
Old 03-17-10, 03:15
nusry nusry is offline
Registered User
 
Join Date: Feb 2010
Posts: 7
yeah.. i found the mistake..
the query should be

INSERT INTO user(user_name,user_password,user_type)
VALUES ('smith','smith123','str')

thnk u for the idea mike
Reply With Quote
Reply

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