gpt4 book ai didi

php - 从mySQL表中获取信息

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

我正在尝试使用一个表单,我希望当用户提交此表单时,mySQL 可以进入我的数据库并获取与登录用户匹配的帐户 ID。获取用户名没有问题但我不知道如何使用用户名从 mySQL 获取帐户 id。

所以我要问的是如何告诉 mySQL 去获取与登录的用户名匹配的帐户 ID,然后将帐户 ID 保存在变量中。

最佳答案

假设这是表的结构:

user:  id|username|otherInfo

select id from user where username='your submitted username';

从结果集中提取并执行任何操作

关于php - 从mySQL表中获取信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13038831/

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