Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2010
    Posts
    7

    Red face Unanswered: 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..

  2. #2
    Join Date
    Jun 2007
    Location
    London
    Posts
    2,527
    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.

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •