06-24-2009, 05:55 AM
|
#1 (permalink)
|
|
The Contributor
Join Date: Jun 2009
Location: Seattle, WA
Posts: 76
Thanks: 1
|
Check that values aren't the same
I am playing around (locally). I want to make up a sign up form for this cms-like thing I am building. I want to make sure that the user login and e-mail aren't in the db already.
My SQL Statement is:
Code:
INSERT INTO tbluser
(user_loginname,
user_pass,
user_firstName,
user_lastName,
user_email)
VALUES(
$userLogin,
$userPass,
$userFirst,
$userLast,
$userEmail)
(SELECT user_loginname,
user_email
FROM tbluser
WHERE NOT (
user_loginname = $userLogin AND
user_email = $userEmail))
I get the following error:
Quote:
|
Could not add: 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 '@yahoo.com)(SELECT user_loginname, user_email FROM tbluserWHERE NOT ( user_login' at line 1
|
Any hints?
|
|
|