I have textarea in the UI which i display text inside it from db and the user edits it and clicks on update button.
while($row=$stmt->fetch(PDO::FETCH_NUM,PDO::FETCH_ORI_NEXT)){
<textarea id= <?php echo $row5[0]; ?> name='upAncText[]' rows=1 cols=40> <?php echo $row5[1]; ?> </textarea><br/>
}
Now when i click on update i have to read the id and texarea value inorder to insert into DB. could anyone let me know how to do this in php?
Change your textarea to something like this:
Now, when you grab
$_POST['upAncText'], it will be an array with keys that are the textarea ID and values that are the user input.FYI,
<?= ?>is shorthand for<?php echo ?>