gpt4 book ai didi

php - 我如何在sqlquery中使用@符号

转载 作者:行者123 更新时间:2023-11-29 05:23:27 25 4
gpt4 key购买 nike

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=test@gmail.com

我收到一个错误:

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

请帮帮我

最佳答案

您缺少 FROM 子句,您拼错了 where 并且您没有将字符串括在引号中:

SELECT u_id, ufirstname, mobileno 
FROM users
WHERE email = 'test@gmail.com'

关于php - 我如何在sqlquery中使用@符号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22963685/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com