Reputation: 21
delimiter $$
CREATE TABLE `users` (
`u_id` int(10) NOT NULL AUTO_INCREMENT,
`ufirstname` varchar(30) NOT NULL,
`ulastname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`pswd` varchar(255) DEFAULT NULL,
`confirmpswd` varchar(255) DEFAULT NULL,
`mobileno` int(12) DEFAULT NULL,
PRIMARY KEY (`u_id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8$$
select u_id,ufirstname,mobileno whrer [email protected]
and i am getting an error:
Error Code: 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 'where' at line 1
please help me
Upvotes: 2
Views: 62
Reputation: 1620
put it in quotes as a String is supposed to
SELECT u_id, ufirstname, mobileno FROM users WHERE email = '[email protected]'
Upvotes: 0
Reputation: 15058
You are missing your FROM clause, you incorrectly spelled where and you didn't surround your string in quotes:
SELECT u_id, ufirstname, mobileno
FROM users
WHERE email = '[email protected]'
Upvotes: 2
Reputation: 59262
Do this:
select u_id,ufirstname,mobileno from users where email='[email protected]'
You need to quote the string value
Upvotes: 1