$sql = mysql_query("SELECT * FROM tabla"); while($row=mysql_fetch_array($sql)){ echo "<input type=text name=x value=\"".$row[dato]."\"> ";