I’m trying to make a form that will update a row in a database. So I can make titles for posts and stuff like that.
Can anyone help me?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Update: Given the short string of code you have provided, I shall make some minor updates to my answer.
Your question is very general, but I’ll provide some code to get you started. For instance if you want to update the title for post #60.
HTML
I’m assuming each post has a unique ID called
id. Again this is a very simple example. For the sake of this example I’ll also assume your database is MySQL. I will use PDO here but feel free to use mysqli, or the mysql driver if you really have to.PHP (update.php)
For more information you can consult the MySQL documentation for the UPDATE query (or the documentation for your RDBMS).
Hopefully this will get you started!