Pagination In PHP

<?php
$page = 1;

if(isset($_GET['page'])){
$page=$_GET['page'];

}

$conn=mysql_connect('localhost','root','');
mysql_select_db('test',$conn);
$result_num_PerPage = 5;
$startResults = ($page - 1) * $result_num_PerPage;
$number_Of_Rows = mysql_num_rows(mysql_query('SELECT id FROM page',$conn));
$totalPages = ceil($number_Of_Rows / $result_num_PerPage);
$select = mysql_query("SELECT * FROM wp_usermeta LIMIT $startResults, $result_num_PerPage",$conn);


How to Display Recent Posts From A Specific Category In WordPress

<?php
$catquery = new WP_Query( 'cat=3&posts_per_page=10' );
while($catquery->have_posts()) : $catquery->the_post();
?>
<ul>
<li><h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>

<ul><li><?php the_content(); ?></li>
</ul>
</li>
</ul>
<?php endwhile; ?>

At the top where it says showpost= change the number to how many posts 
you want to display, and cat=3 is the id of the category, so change the 
ID of the category to pick which category will you be displaying.

How to integrate Print Command in any web page

1. Coding Start from here

<html>
<body>
<div id="printTable">
Lorem Ipsum is simply dummy text of the printing and typesetting 
industry. Lorem Ipsum has been the industry's standard dummy text 
ever since the 1500s, when an unknown printer took a galley of .

</div>


Save data from .CSV file to database

1. Save data from .CSV file to database using php

public function savefile()
    {
        die('Remove die to action');
        error_reporting(E_ALL ^ E_NOTICE);   
        if(!defined('DS')) {
            define('DS',DIRECTORY_SEPARATOR);
        }
        mysql_connect('localhost', 'dbuser', 'db_password');
        mysql_select_db('db_name');

Executing php inside a WordPress widget

Executing php inside a WordPress widget without any plugin

Sometimes in your WordPress theme you need to execute custom php code in a widget, because you want to display different information according to the category you are in, or simply because you need to execute a php script into that widget.
There are a lot of plugins doing this task, adding a new type of widget generally called “php widget”, but rather than installing a plugin this simple job can be done simply adding in functions.php file of your theme these few lines:
/*-------------------------  START -------------------------------------*/
add_filter('widget_text','execute_php',100);
function execute_php($html){
     if(strpos($html,"<"."?php")!==false){
          ob_start();
          eval("?".">".$html);
          $html=ob_get_contents();
          ob_end_clean();
     }
     return $html;
}

/*---------------------------- END ----------------------------------*/ 

Which will turn the default Text widget into a php enabled widget.
Adding this feature directly to functions.php allows you to create a theme with this built in feature without the need of an external plugin.