duanlu0075 2009-06-02 14:15
浏览 56
已采纳

Jquery - > php - > mysql和动态表单字段

I have a multi page form which uses multiple tables in mysql for the entered values. One of the pages has a form which needs to have the option of enabling the user to click a + to add an extra line if they want to include extra information. There can be any number of lines added.

When the user clicks the +, jquery and php inserts the current userid in a row in the database table, this is then updated when more information is entered.

The problem I've got is to how to insert any number of rows for that particular id - when the data is entered, a blur event sends the data to the php code for updating the database. However, the problem I have is that it will update ALL the rows with that particular user id and not the current one.

What would be the best way of taking the data entered on the new rows and updating the database - I assume that I will have to use the ID value rather than userid value as that will be unique, or is there another way of doing it?

Thanks for any suggestions you can give, this one is clouding my mind currently...

  • 写回答

4条回答 默认 最新

  • duanhuoyao7011 2009-06-02 14:29
    关注

    Well, I think that you need to use a pair of identifiers, your userid and the field id. For editing only filedid would be enought but when you need to list all the user fields another reference will be necessary.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?