dongshu9458 2015-06-08 15:20
浏览 9
已采纳

这个查询有什么问题吗? 使用ands

I've got no errors, nothing, but for some reason my page is blank, thanks to this:

$userBusca = mysqli_query($conn, "SELECT * FROM account.login_admin WHERE login='".$login."' AND password='".$password."' AND key='".$key_load."'") or die(mysql_error());

The login and password are froma form, and the key_load is a string from a text file.

Is there anythin wrong with this?

EDIT: everything works without the key='".$key_load."'

  • 写回答

1条回答 默认 最新

  • duanmao9918 2015-06-08 15:23
    关注

    AND key

    wrap it in ticks

    AND `key`
    

    Or rename it to something else, like the_key, but don't try keys because that too is a MySQL reserved word.

    You're also mixing APIs with mysql_error() which should be mysqli_error($conn)

    • Those different MySQL APIs/functions do not intermix with each other.

    Also, am hoping you are storing a safe hash.

    If not:

    For password storage, use CRYPT_BLOWFISH or PHP 5.5's password_hash() function. For PHP < 5.5 use the password_hash() compatibility pack.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法