SkyRanger Posted March 21, 2012 Share Posted March 21, 2012 I am wondering if there is a way to update a certain row based on form? <form> ddbox entrys a b c d postdata = text goes here </form> update page: if ddtext = a update table set a = postdata else if ddtext = b update table set b = postdata etc is this possible? Quote Link to comment Share on other sites More sharing options...
smerny Posted March 21, 2012 Share Posted March 21, 2012 don't entirely understand your pseudo <form>, but from what i can tell i don't see a reason why it wouldnt be possible. Quote Link to comment Share on other sites More sharing options...
SkyRanger Posted March 21, 2012 Author Share Posted March 21, 2012 Yeah got sloppy putting the form demo in <form method=post action=updatedata.php> Choose Section :<select name="section"> <option></option> <option>a</option> <option>b</option> </select></form> Page Info:<textarea name="areadata" style="width: 234px; height: 121px"></textarea> <nput type=button name=submit value=Enter Data> on the updatedata page i would have if section==a update table set a=areadata else if section==b update table set b=areadata etc... This will work or is there an easier way to do this? Quote Link to comment Share on other sites More sharing options...
smerny Posted March 21, 2012 Share Posted March 21, 2012 well the options will need values on your table though, what are a and b? fields? it would set the field in every row values? syntax is off.. would be something like UPDATE table SET somefield='$areadata' WHERE someotherfield='a' 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.