htmlboss Posted June 15, 2015 Share Posted June 15, 2015 Sorry if this sounds like a noob question ( ), but how would I go about retrieving data POSTed from a text input field (sample below), update the respective row (WHERE id=1 for example) and then display the data in the same input fields again for ease of editing (all-the-while using PDO of course )? <form action="form.php" method="POST"> <input type="text" name="header1" placeholder="Header text here"> <textarea name="summary1" placeholder="Summary text here"> <input type="submit" name="submit" value="Update Info"> </form> Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted June 16, 2015 Share Posted June 16, 2015 if Barand (or someone else) doens't get here fist I'll get back to you in 7 hours. It's way too late just now (where I am) It's not that it's a complicated answer, just a long one to give in full. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted June 16, 2015 Share Posted June 16, 2015 this sounds like another current thread, where someone just posted what they want and expected someone to do everything for them, especially since the OP in this thread is copy/pasting this question on multiple help sites. first of all, your question about how to do this task isn't a mysql database question. you may be using a mysql database, but until you have a sql query statement at all, you don't have a mysql database problem. next, processing form data and retrieving and displaying database information is what php was created to do and there are 100's of thousands of examples posted on the web for you to find, examine, and learn the basics from. in short - where exactly are you stuck at when you tried to do this? programming help forums are not here to find, give, or write code for you. without knowing what sort of problem you had when you tried this, the answer could range from a) you need to buy a good php/mysql book and/or take a programming class to z) you have a logic or syntax problem in your code that we could help with if you posted your code and told us what sort of error or symptom you got from that code. Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted June 16, 2015 Share Posted June 16, 2015 aww, so it's just another "do my homework for me" thread? can we get a color coding system and highlight these things? I think a putrid orange would do... Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted June 16, 2015 Share Posted June 16, 2015 the other thread about retrieving data based on an input id, is just the first step in the U (update) part of a CRUD assignment. this thread seems to be asking about a part of the same U process, but skipped the first step of retrieving the existing data to populate the form fields. this looks more like the C (create) form was just dumped here without having any code to populate it with existing values. Quote Link to comment 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.