从数据库检查密码,我做错了什么?
-(IBAction)EnterButtonPressed:(id)sender
{
const char *sql = "SELECT AccessCode FROM UserAccess";
double result = ([Password.text doubleValue]);
if(sql == result )
{
NSLog(@"Correct");
}
else {
NSLog(@"Wrong");
}
}
-(IBAction)EnterButtonPressed:(id)sender
{
const char *sql = "SELECT AccessCode FROM UserAccess";
double result = ([Password.text doubleValue]);
if(sql == result )
{
NSLog(@"Correct");
}
else {
NSLog(@"Wrong");
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你做错的主要事情是没有将该 SQL 查询发送到数据库。您可能还应该添加某种
WHERE
子句。而且...好吧,说实话,该代码有很多错误。The main thing you're doing wrong is not sending that SQL query to the database. You probably ought to add in some kind of
WHERE
clause too. And... well, there's quite a lot wrong with that code to be honest.