如何从数据库表中提取数据并将该数据放入表单中的只读文本输入中以供用户查看。
<input readonly type="text" name="em1" id="em1"/>
对于这个特定字段,我想使用 $username 变量和我创建的 session 从当前登录用户行中名为 wmyt000 的列中提取数据,以获取名为 cash_flow_plan 的表中当前登录用户的用户名
我使用mysql和php
我还没有尝试过任何事情。我正在调查mysql_fetch_array
但想要显示其行的所有用户信息。
最佳答案
i havnt attempted to try anything yet.
是的。好吧,如果你有的话,你就会知道你可以用它做比你想象的更多的事情。
如果您编写一个限制结果的查询,那么您将得到您想要的结果。
$query = "SELECT wmyt000 FROM cash_flow_plan WHERE username = '$username'"
$row = mysql_fetch_row($query);
print_r($row); // now you can see the structure of your array. access it accordingly.
关于php - 使用php拉取特定表行列数据以html形式输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11935391/