DicksonTan
Forum Replies Created
-
Forum: Plugins
In reply to: [EZ SQL Reports Shortcode Widget and DB Backup] Using user's input dataOh! I just figured out again..
It should be
SELECT * FROM wp_cf7dbplugin_submits WHERE field_value = ‘<?php $_POST[prdt]; ?>’field_value 🙂
Thanks alot, its working now 😉
Dickson
Forum: Plugins
In reply to: [EZ SQL Reports Shortcode Widget and DB Backup] Using user's input dataInitially I tried using
SELECT * FROM wp_cf7dbplugin_submits WHERE field_name = “<?php $_POST[‘choice’]; ?>”
in your plugin, and use the shortcode over the page with user input. However cant seem to get the input working…
So I tried putting it in the template page of php..Is that the correct way of sending input to the plugin?
🙂
DicksonForum: Plugins
In reply to: [EZ SQL Reports Shortcode Widget and DB Backup] Using user's input dataOk I got it!
It should be
<?php
$str = “SELECT * FROM wp_cf7dbplugin_submits where field_name = ‘”. $_POST[‘choice’].”‘”;…?>
Thank You!
DicksonForum: Plugins
In reply to: [EZ SQL Reports Shortcode Widget and DB Backup] Using user's input dataThank You!
I’ve use the following codes in my template, it doesn’t seem to retrieve anything, but works only if I hard coded the ‘choice’.
Could it be my syntax error here? I tried both $_POST[‘choice’] and $_POST[choice]..
<?php
$str = “SELECT * FROM wp_cf7dbplugin_submits where field_name = “. $_POST[‘choice’];$res = $wpdb->get_results( $str );
foreach ( $res as $a ) {echo $a->field_name. ” = “. $a->field_value.”
“;}
?>Dickson