pets2soul Posted June 25, 2008 Share Posted June 25, 2008 Hello everyone, I'm converting my plain html website into a php one, and I'm working on the backend now... I built a page to submit articles to MySQL, and another page to list all the entries in the database, from there I can link to the article editing page to call up article headline, body and date etc. into their own field in a form...However, the editing page is not working properly... I made some screen captures to describe the problem... 1. http://www.prophet-records.com/images/phpprob01.gif This is my article submitting page, I captured it to show you what supposed to be in the article... 2. http://www.prophet-records.com/images/phpprob02.gif This is the article editing page...as you can see...article headline and date showed up, but the textareas appear to be empty. 3. http://www.prophet-records.com/images/phpprob03.gif I checked its source code with my browser, the highlighted part is where the article body is, it seems alright there, but it just doesn't appear on the web page.... Below is the code for the article editing page.... <?php $con = mysql_connect("hostname","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("dbname", $con); $sql = mysql_query("SELECT * FROM table WHERE fname='$fname'") or die(mysql_error()); while ($rw = mysql_fetch_assoc($sql)) { //now we display a form with the users info in text boxes and areas. echo '<form action="update.php?fname='.$rw['fname'].'" method="post"> <table width="510" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="38" align="left" valign="top"><a href="dataentry.php">Add</a> | <a href="datalist.php">List</a> | <a href="annuallist.php">Annual</a></td> </tr> <tr> <td height="28" align="left">Title: <input name="headline" type="text" maxlength="40" value="'.$rw['headline'].'"> </td> </tr> <tr> <td align="left">Content:<br><textarea name="newscont" cols="70" rows="15" value="'.$rw['newscont'].'"></textarea> </td> </tr> <tr> <td align="left"><input name="date" value="'.$rw['date'].'"> </td> </tr> <tr> <td align="left">Brief:<br><textarea name="newsbrf" cols="70" rows="10" value="'.$rw['newsbrf'].'"></textarea> </td> </tr> <tr> <td height="28" align="left">File Name: <input name="fname" type="text" maxlength="30" value="'.$rw['fname'].'"> </td> </tr> <tr> <td height="32" align="center"><input type="submit"> </td> </tr> </table> </form>'; } mysql_close($con) ?> Would anyone tell me what went wrong? Quote Link to comment https://forums.phpfreaks.com/topic/111814-solved-data-fed-but-doesnt-show-in-the-textarea/ Share on other sites More sharing options...
scottybwoy Posted June 25, 2008 Share Posted June 25, 2008 Textarea doesn't use a value key. Use <?php <textarea name="newscont" cols="70" rows="15">' . $rw['newscont'] . '</textarea> ?> Quote Link to comment https://forums.phpfreaks.com/topic/111814-solved-data-fed-but-doesnt-show-in-the-textarea/#findComment-573981 Share on other sites More sharing options...
pets2soul Posted June 25, 2008 Author Share Posted June 25, 2008 Ahhhhh.....you are absolutely right!!! It is working now! Thank you, thank you! Quote Link to comment https://forums.phpfreaks.com/topic/111814-solved-data-fed-but-doesnt-show-in-the-textarea/#findComment-573982 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.