wordpress savequeries code example

Example 1: debug wordpress

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

Example 2: wordpress debug config

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );

Example 3: wordpress query to save in database

 $_POST['yourname'],
            'emails'    => $_POST['customer_email'],
            'gender' => $_POST['customer_gender'],
            'age' => $_POST['customer_age']
        );
        //echo "
"; print_r($data);

        $success=$wpdb->insert( $table, $data );
        if($success){
            echo 'data has been save' ; 
        }
    } else {
    		echo "data not save";
    	}
        ?>
        
Your name: Your Email:
Gender:Male Female
Your Age:

Tags:

Misc Example