The error I'm getting is below:
Error 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 '"testaddy@exampleaddress.com' at line 2

This is the validation code for my email address:

  if (empty($formVars["CEmail"])) 
      // the user's email cannot be a null string
      $errorString .= "\n<br>You must supply an email address.";

  elseif (!eregi($validEmailExpr, $formVars["CEmail"]))
      // The email must match the above regular expression
	  $errorString .= "\n<br>The email address must be in the name@domain format.";
  elseif (strlen($formVars["CEmail"]) > 50)
      // The length cannot exceed 50 characters
	  $errorString .= "\n<br>The email address can be no longer than 50 characters.";

This is the test data:
testaddy@exampleaddress.com

If you need the files for context, let me know.

Thanks for any help you all can provide,
Jim

    Well, that code is obviously irrelevant, as it has nothing to do with MySQL (notice how MySQL was mentioned in the error message?). What does "the manual that corresponds to your MySQL server version" say?

      I checked the online documentation and it gave a mention of the error code I got as a parse error I think (the text was covered by other text). The text that covered 1064 was "parse error" (listed under MYSQL API's in the manual). I used perror and it gave me the explanation "Error Code 1064:Unknown error" so where does that leave me? and whats the fix for my error? I appreciate all the help.

      Jim

        How can anyone tell? Like I said, the code you posted has nothing to do with MySQL. All I can guess is that you're missing quotes around the email address in the query.

          It was a quote issue and once I fixed it, everything compiled cleanly. Though now I have the problem that it puts data (after entered on form) into the db but reports that every field was empty (a big contradiction). I'll attach a .zip file so maybe someone can help me out on that issue. The .zip file has my errors received in a file. Thanks for the help.

          Jim

            That part is only validation.wheres the other part in your programme? Can you post it whole script?

            Nilanka

              Write a Reply...