> I'm getting closer...! > > I SELECT: > > $sql = "SELECT UserFirstName FROM RegisteredMembers WHERE > UserID='$_POST[TXT_UserID]'"; > $result5 = mysql_query($sql) or die ("error: couldn't select UserID from > database. Please e-mail: [EMAIL PROTECTED] with this > error > message."); > while($row = mysql_fetch_array($result5)) > { > $User=$row["UserFirstName"]; > $UserFurtherComments=$row["FurtherComments"]; > } > > I then use a form: > > echo "<tr>"; > echo "<td>a little about me:</td>"; > echo "<td><input type = 'text' name = 'TXT_FurtherComments' > value='FurtherComments field should appear here'></td>"; > echo "<td>20 characters max</td>"; > echo "</tr>"; > > But if is use "value='$UserFurtherComments' nothing appears in the form > field, even though the database holds a value in that field. > > What am I doing wrong...? > > -- > ----------------------------- > Michael Mason
Do you need to use a while loop? If you're expecting only 1 query result from the database, skip the while loop and simply use: <?php ... $row = mysql_fetch_array($result5); ?> <td> <input type = 'text' name = 'TXT_FurtherComments' value='<?php echo $row['UserFirstName']; ?>'> </td> If more than 1 result is expected, move your while loop to here: <table> <?php while ($row = mysql_fetch_array($result5)) { ?> <tr> <td>a little about me:</td> <td><input type = 'text' name = 'TXT_FurtherComments' value='<?php echo $row['UserFirstName']; ?>'></td> <td>20 characters max</td> </tr> <?php } ?> </table> And one last thing, you $_POST is set wrong: $_POST['TXT_UserID'] --Matthew Sims --<http://killermookie.org> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php