cannot get a basic INSERT command to work..

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bambers
    New Member
    • Apr 2007
    • 5

    cannot get a basic INSERT command to work..

    hi all

    i cannot get the following command to work, any ideas?

    $sql_query = "INSERT INTO 'members' (uname, fname, lname, pword, email) VALUES ('$uname', '$fname', '$lname', '$pwordmd5', '$email')";

    its not an issue with my db connections, as i have other sql staments working in the script

    many thanks
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Please read the Posting Guidelines before posting a question.
    Please follow my directions, post the error message you receive.


    Originally posted by Bambers
    hi all

    i cannot get the following command to work, any ideas?

    $sql_query = "INSERT INTO 'members' (uname, fname, lname, pword, email) VALUES ('$uname', '$fname', '$lname', '$pwordmd5', '$email')";

    its not an issue with my db connections, as i have other sql staments working in the script

    many thanks

    Comment

    • Bambers
      New Member
      • Apr 2007
      • 5

      #3
      i dont receive any errors

      Comment

      • code green
        Recognized Expert Top Contributor
        • Mar 2007
        • 1726

        #4
        cannot get the following command to work, any ideas?
        [PHP]$sql_query = "INSERT INTO 'members' (uname, fname, lname, pword, email) VALUES ('$uname', '$fname', '$lname', '$pwordmd5', '$email')"; [/PHP] This is not a command. It is a string variable.
        i dont receive any errors
        Well you should if you are writing good code. Like Motoma said. What is the error?

        Comment

        • Motoma
          Recognized Expert Specialist
          • Jan 2007
          • 3236

          #5
          Originally posted by Bambers
          i dont receive any errors
          You get no errors at all, even when you put the ini_set headers and the "or die(mysql_error ());" at the end of your query?

          If that is the case, your INSERT statement is working. Or you aren't executing the query.

          Comment

          Working...