Fill textfield with data
Posted: Mon Jul 25, 2016 3:27 am
Hi
Is it possible to fill data from a mysql query into a textfield and then update the mysql table?
First of all I have tried to fill data like this:
Is it possible to fill data from a mysql query into a textfield and then update the mysql table?
First of all I have tried to fill data like this:
Code: Select all
<html>
<head>
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<?php
$id = $_POST['id'];
include './config/config.php';
include './config/opendb.php';
$result = mysql_query("SELECT * FROM RegTable WHERE Id = '$id'")
or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
$respons = $row['Responsible'];
}
?>
<TABLE WIDTH=30% BORDER=0 CELLPADDING=0 CELLSPACING=0 STYLE="page-break-before: always">
<COL WIDTH=128*>
<COL WIDTH=128*>
<TR VALIGN=TOP>
<TD WIDTH=50%>
<p>Responsible: </p></TD>
<TD WIDTH=50%>
<P><input type="text" size="30" maxlength="30" id="$respons" name="responsible"></P>
</TD>
</TR>
</TABLE>
</html>