Delete or modify entry in PHP
-
Hi, nice plugin. It works really good and does what I need. I have a problem. I want to create a short-code where it can delete an entry or modify an entry in the table with the user entered information. I don’t have the information of the mysql (username, password, etc.), and neither I want to ask for it. For now this is in my short code:
require_once(ABSPATH . ‘wp-content/plugins/contact-form-7-to-database-extension/CFDBFormIterator.php’);
$exp = new CFDBFormIterator();
$exp->export($atts[‘form’], $atts);
$unit = $_POST[“fname”];$formName = $atts[‘form’];
$userId = $atts[‘userId’];
$unit = $atts[‘unit’];
global $wpdb;
$wpdb->query(“DELETE fromwp_cf7dbplugin_submits
WHERE (field_name= ‘menu-726’
ANDfield_value= ‘%s’) AND
(field_name= ‘user-id’
ANDfield_value= ‘%s’)
ANDform_name= ‘%s'”,$unit,$userId,$formName);Sorry for my lack of PHP and MySQL, data bases is not my strong part of computer science.
http://ww.wp.xz.cn/extend/plugins/contact-form-7-to-database-extension/
The topic ‘Delete or modify entry in PHP’ is closed to new replies.