Displaying SQL query result from user input via wpdb

use this snippet it works <?php if(isset($_POST[“ICNo”])) { global $wpdb; $name = $_POST[“ICNo”]; $resultsap = $wpdb->get_results( $wpdb->prepare( “SELECT * FROM wp_apelc_users WHERE icno = %s”, $name ) ); foreach ($resultsap as $row) { echo ‘Name: ‘ . $row->name; } } ?> <form method=”post”> <div> Your IC No: <input type=”text” name=”ICNo”> <input type=”submit” name=”submit” value=”Submit” > … Read more

How set a while with a function

a. from the return function dosome(){ return true; } OR function dosome( param = true ){ return param; } var = dosome(); while ( var ){ need(); } b. while loop from fixed param TRUE function need( $param = true) { while ( param ){ $updates = get_point(); echo $updates[‘selector’]; echo ‘done’; } } need(); … Read more

        out of nowhere

Sometimes there can be space characters before the <?php at the top of the file. Or space characters after a closing ?> at the end of the file. The closing ?> is not needed in PHP files. But anything before the opening <?php, or after the not-needed ?> closing will get rendered on the page.

Call to Action Button – Resize Help [closed]

This is not so much a WordPress questions as it is a simple CSS question, but adding this rule to your theme’s CSS should make the button text the same size as the surrounding text. .navbar .header-right a { font-size: 11px; } If you also wanted to reduce the overall size of the box that … Read more

How to display content if user meta data isn’t empty with shortcode

Your shortcode can look like this: [check-if-empty usermeta=”last_name”] Is not empty [/check-if-empty] The parameter called “usermeta” is added to your function ($atts) and it’s value is used to check the userdata. function func_check_if_empty( $atts, $content = null ) { if ( is_user_logged_in() ) { /* check if logged in */ $user_meta = $atts[‘usermeta’]; /* get … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)