Support » Plugins » Hacks » $wpdp->insert or update for poll plugin?

  • Hi!

    Working on a sort of a poll plugin. On each anwser in the poll there is a “vote” submit button that is connected with the answers ID.

    At first, I used the $wpdp->update to increase the value by one. With that solution the submit button only worked once per answer. Don´t know the reason for that though.

    Another member at this forum helped me out and said I should use the £wpdp->insert method instead, when I tried that some new rows where added to the table.

    So, my question is, how do I write a ->insert statement that only increases the value? Or, how do I write a update ->update statement that can be used more than once.

    If you have any questions about my database setup or similiar, tell me! =)

    Thanks! Regards.

Viewing 1 replies (of 1 total)
  • Hi, smilesX. You would only use an insert statement to insert new records. To change an existing record, you would use an update. If you post your table structure (i.e. the columns and data types), your current code for inserting and updating, and explain how it works, I’ll see what I can do.

Viewing 1 replies (of 1 total)
  • The topic ‘$wpdp->insert or update for poll plugin?’ is closed to new replies.