gpt4 book ai didi

php mysql 未选择表

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

我有点困惑,我有一个名为 attempts 的表,用于检查用户失败的登录尝试,但它不会选择该表,但如果我选择另一个表,它就可以工作

这不起作用:

$test_q = $config->query("SELECT * FROM attempts");
print_r($test_q->fetch(PDO::FETCH_ASSOC));

这有效:

$test_q = $config->query("SELECT * FROM another_table");
print_r($test_q->fetch(PDO::FETCH_ASSOC));

为什么会这样?

最佳答案

$test_q = $config->query("SELECT * FROM `attempts`");
print_r($test_q->fetch(PDO::FETCH_ASSOC));

因为 attempts 是一个 mysql 函数,如 left、right、min、max 等。

关于php mysql 未选择表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10269618/

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