在文本框中显示数据 [英] Display data in textbox

查看:70
本文介绍了在文本框中显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Helo编码器



我正在尝试使用php将mysql数据检索到文本字段,我的代码工作得很好,除了它无法检索所有数据例如,当它应该检索纽约时,它只能在状态文本字段中检索新。这是我的代码.....







Helo Coders

I'm trying to retrieve mysql data on to text fields using php, my code works out fine except its not able to retrieve all the data e.g it can only retrieve 'New' in the state text field when it is supposed to retrieve 'New York'. Here is my code.....



<?php

while(isset ($_POST['Go'])){

$search_table=$_POST['nrcc'];

$query = mysql_query("SELECT * FROM students WHERE NRC='".mysql_real_escape_string($search_table)."'");

while($row=mysql_fetch_assoc($query)){

echo "<table>";
echo "<form >";
echo "<tr>";
echo "<td align='right' bgcolor='#ffffcc' border='2'>Name:</td><td>" ."<input  type=text readonly class=textbox name=pc value=" .$row['FullName'] . " </td>";
echo "</tr>";
echo "<tr>";
echo "<td align='right' bgcolor='#ffffcc' border='2'>Gender:</td><td>" ."<input type=text readonly class=textbox name=status value=" .$row['Gender'] . " </td>";
echo "</tr>";
echo "<tr>";
echo "<td align='right' bgcolor='#ffffcc' border='2'>Age Group:</td><td>" ."<input type=text class=textbox name=age value=" .$row['AgeGroup'] . " </td>";
echo "</tr>";
echo "<tr>";
echo "<td align='right' bgcolor='#ffffcc' border='2'>NRC:</td><td>" ."<input type=text name=nrc  class=textbox value=" .$row['NRC'] . " </td>";
echo "</tr>";
echo "<tr>";
echo "<td align='right' bgcolor='#ffffcc' border='2'>Organisation:</td><td>" ."<input type=text minlength=12 class=textbox name=inst value=" .$row['Organisation'] . " </td>";
echo "</tr>";
echo "<tr>";
echo "<td align='right' bgcolor='#ffffcc' border='2'>Purpose:</td><td>" ."<input type=text class=textbox name=purpose </td>";
echo "</tr>";
echo "<tr>";
echo "<td align='right' bgcolor='#ffffcc' border='2'>State:</td><td>" ."<input type=text class=textbox name=state value=" .$row['Province'] . " </td>";
echo "</tr>";
echo "<tr>";
echo "<td align='right' bgcolor='#ffffcc' border='2'>Date:</td><td>" ."<input type=text class=textbox name=dbdate id=date </td>";
echo "</tr>";
echo "<tr>";
echo "<td align='right' bgcolor='#ffffcc' border='2'>Address:</td><td>" ."<textarea  class=textbox cols=100 rows=4 name=dbdate id=date value=" .$row['Address'] . " </td> </textarea>";
echo "</tr>";
echo "<center>";
echo "<tr>";
echo "<td><input type='submit' name='save' value='Update'  /></td></tr>";
echo "</tr>";
echo "</center>";
echo "</form>";
}
echo "</table>";
}
?>

推荐答案

_POST ['Go'])){ < span class =code-summarycomment>

_POST['Go'])){


search_table =
search_table=


_POST [' nrcc'];

_POST['nrcc'];


这篇关于在文本框中显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆