i had some trouble when updating a mysql field, i had 2 text fields and 1 textarea fields, both the text fields updated ok through this query: but textarea field is not updating..

edit.php

    <?php
        include('connect.php');
        $id=$_GET['id'];
        $result = $db->prepare("SELECT * FROM telugunews WHERE id= :userid");
        $result->bindParam(':userid', $id);
        $result->execute();
        for($i=0; $row = $result->fetch(); $i++){
    ?>
    <form action="edit-ac.php" method="POST">
    <input type="hidden" name="id" value="<?php echo $id; ?>" />

    News Title<br>
    <input type="text" name="newstitle" value="<?php echo $row['newstitle']; ?>" size="96" maxlength="95" /><br><br>

    News Image Link<br>
    <input type="text" name="newsimage" value="<?php echo $row['newsimage']; ?>" size="96" maxlength="95" /><br><br>

    News Content<br>
    <textarea name="newscontent" value="<?php echo $row['newscontent']; ?>" cols="30" rows="10" id="newscontent">
Re: Problem in Updating PHP MYSQL data through a textarea field 80 80

Try this way

<textarea name="newscontent"  cols="30" rows="10" id="newscontent">

<?php echo $row['newscontent']; ?>

</textarea>
Re: Problem in Updating PHP MYSQL data through a textarea field 80 80

just wondering, what is the purpose of for loop and increment? Is it for speed or for some other reason/s?

Re: Problem in Updating PHP MYSQL data through a textarea field 80 80

whats your update query on the edit-ac.php page, oh as well as your $whatever="whatever" ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.