Jump to content

Update


SkyRanger

Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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'

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.