使用php将特定的表行列数据输出到html中

时间:2022-11-13 16:01:51

how do i pull data from my database table and put that data into a readonly textinput in a form for a user to see.

我如何从我的数据库表中提取数据并将该数据放入表单中的只读文本输入*用户查看。

<input readonly type="text" name="em1" id="em1"/>

for this specific field i want to pull the data from a column called wmyt000 in the row of the currently logged in user using a $username variable with session that i created to get the current logged in users username in a table called cash_flow_plan

对于此特定字段,我想使用$ username变量从当前登录用户的行中的名为wmyt000的列中提取数据,该变量具有我创建的会话以在名为cash_flow_plan的表中获取当前登录用户的用户名

im using mysql and php

即时通讯使用mysql和PHP

i havnt attempted to try anything yet. i was looking into mysql_fetch_array but that wants to display all of the users information for their row.

我还试图尝试任何尝试。我正在研究mysql_fetch_array,但是想要显示其行的所有用户信息。

1 个解决方案

#1


1  

i havnt attempted to try anything yet.

我还试图尝试任何尝试。

ya. well, if you had, you'd know that you can do more with it than you think.

雅。好吧,如果你有,你会知道你可以用它做比你想象的更多。

if you write a query limiting your results, then you're going to get what you want.

如果你写一个限制你的结果的查询,那么你将得到你想要的。

$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.

#1


1  

i havnt attempted to try anything yet.

我还试图尝试任何尝试。

ya. well, if you had, you'd know that you can do more with it than you think.

雅。好吧,如果你有,你会知道你可以用它做比你想象的更多。

if you write a query limiting your results, then you're going to get what you want.

如果你写一个限制你的结果的查询,那么你将得到你想要的。

$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.