user3515355
user3515355

Reputation: 21

how do i can use @ symbol in sqlquery

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

Answers (3)

Cagy79
Cagy79

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

Linger
Linger

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

Amit Joki
Amit Joki

Reputation: 59262

Do this:

select u_id,ufirstname,mobileno from users where email='[email protected]'

You need to quote the string value

Upvotes: 1

Related Questions