Store and Encrypt Contact Form 7 Submissions in Database? [closed]

As @kero said, use a CF7 hook. I’d use the wpcf7_before_send_mail hook. Grab data from the CF7 form object’s fields, and use those values to store data. I wrote a post to myself on how to get data from the CF7 form object here: http://securitydawg.com/changing-contact-form-7-with-the-wpcf7_before_send_mail-hook/ . You could use that to get started, just insert … Read more

How to execute mulitple statement SQL queries using $wpdb->query?

TL;DR This is not possible with wpdb. Use dbDelta(). Even better, use something else to run raw queries. Explanation wpdb->query() uses the mysql_query() function. From PHP manual: mysql_query() sends a unique query (multiple queries are not supported) to the currently active database on the server that’s associated with the specified link_identifier. In order for that … Read more

Safe way to find last inserted id in a table?

At a higher level, there truly isn’t any means to know if the php/db connector will return the correct id by relying on $wpdb->insert_id. The only way to be 100% sure is to have add a key you know will be unique (and indexed as such); you can then retrieve the id by querying the … Read more

If I consider changing my WordPress DB tables to InnoDB, will it have an effect on the way WordPress works?

There’s quite a lot of information on here about switching to InnoDB https://wordpress.stackexchange.com/search?q=innodb There are a number of things to think about: InnoDB is helpful with you’re faced with contention – ie when you have tables that are being written to as well as being read InnoDB does not support FULLTEXT indexes so plugins that … Read more