Jump to content

[SOLVED] Add new fields/rows [button] to a webpage


aniket_dj

Recommended Posts

Hi,

 

I am new to this forum as i am new to PHP in general. So a general hello to all folks in here.

 

Basically what I am doing is getting tuples from database (MySQL) and putting them in a table using PHP+HTML. After the whole table is displayed, I want the user to add another row to the database by having an add key.

 

The add key, adds a new row (with a the same number of fields as the previous tuple). After hitting the submit button, the changes should be reflected back into the database.

 

As far as I know (for a novice to web programming in general), I can have a single submit button which submits the form contents to the server. As this is an update webpage operation, rather than a submit op, how do I go about it?

 

Thanks.

 

~Aniket.

Link to comment
Share on other sites

Could you post the code so it would be easier to help you.

But if you just do a button like this

 <input type="submit" value="Send">

the page should automatically update itself as long as you take the values in the form fields (they will be in $_POST) and add them to the data base so when the loop runs and prints out the table it will add the last entry.

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.