help with this code

by 6 replies
7
I am trying to insert data into my data base using:
76: $sql = "INSERT INTO client (`name`,`email`,`address`,`userid`,`password`) VALUES('$name','$email','$address','$userid', '$password' )";


but I am getting this syntax error when I view it through browser:

Parse error: syntax error, unexpected T_VARIABLE, expecting ']' in /home/getyourn/public_html/signup.php on line 76


Pls what is the matter with the insert statement or is there other hidden problem?
Thanks.
#programming #code
  • Do you really think $pas sword is a good variable name?
    • [1] reply
    • Since when does the name of a PHP variable matter (unless it's reserved)? It's not like it's exposed to the public eye.
      • [1] reply
  • try:

    $sql = "INSERT INTO client ('name','email','address','userid','password') VALUES ('$name','$email','$address','$userid','$password' )";
  • it means you forgot to end line 75 with a semicolon

    bet line 75 looks something like this:
    $variable = 'something'

    when it should look like
    $variable = 'something';
    • [ 1 ] Thanks

Next Topics on Trending Feed

  • 7

    I am trying to insert data into my data base using: 76: $sql = "INSERT INTO client (`name`,`email`,`address`,`userid`,`password`) VALUES('$name','$email','$address','$userid', '$password' )";