[英]pull specific table row column data to output in html using php
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. 我如何从数据库表中提取数据,并将该数据以某种形式放入只读的textinput中,以供用户查看。
<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
但是想要显示其行的所有用户信息。
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.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.