Return data to textarea
Posted: Sat Oct 24, 2009 2:53 am
Hi all can someone tell me if this is possible or if I need different syntax.
the first 3 work and return info, but can you get info to textarea where it is from a medium text field.
the first 3 work and return info, but can you get info to textarea where it is from a medium text field.
Code: Select all
$query = "SELECT name, phone, dept, desc2 FROM report WHERE id=$id";
$result = @mysql_query ($query); // Run the query.
if (mysql_num_rows($result) == 1) { // Valid user ID, show the form.
// Get the user's information.
$row = mysql_fetch_array ($result, MYSQL_NUM);
// Create the form.
echo '<h2>Edit a Report</h2>
<form action="one.php" method="post">
<p>Name: <input type="text" name="name" size="15" maxlength="15" value="' . $row[0] . '" /></p>
<p>Phone: <input type="text" name="phone" size="15" maxlength="30" value="' . $row[1] . '" /></p>
<p>Department: <input type="text" name="dept" size="20" maxlength="40" value="' . $row[2] . '" /> </p>
<p>Report: <textarea name="desc2" value="' . $row[3] . ' "></textarea> </p>
<p><input type="submit" name="submit" value="Submit" /></p>
<input type="hidden" name="submitted" value="TRUE" />
<input type="hidden" name="id" value="' . $id . '" />
</form>';