jpearson311 Posted June 8, 2007 Share Posted June 8, 2007 Hello everyone: I'm building a php admin area right now and have a question. Right now, when I access the admin area, I'm using this code to display the information presently in the database and to also enable the user to add new information: <?php while($row = mysql_fetch_array($result)){ ?><p><form><textarea><?php echo $row['news']; ?></textarea><input name="save" type="submit" value="Save" class="saveBtn" /><input name="delete" type="submit" value="Delete" class="deleteBtn" /></form><?php echo "<br /><br />"; ?> </p><?php } ?><h2>Add Information</h2><p>If you would like to add information, please type it in the box below and click save.<br /><br /><form><textarea></textarea><input name="save" type="submit" value="Save" class="saveBtn" /></form></p> I have the first textarea which displays all the information presently in the database, which is a loop, so if there is more than one row, there is a text area displayed for each row in the database. I then have "delete" and "save" buttons that are spit out for each row as well. Below, I have a textarea where the user can add information into the database by typing int the box and clicking save. My question is, since I'm new to mysql databases, for the first section, how do I get it to delete the displayed text and save in the same row if the user chooses to edit the present information? Also, if the user simply wants to use the bottom box to add new information, how do I make it work? I'm fairly familiar with PHP, but only a little with MySQL. Any help would be great appreciated. Cheers! JPearson311 Quote Link to comment https://forums.phpfreaks.com/topic/54693-php-admin-anyone/ 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.