Use of MYSQL Limit vs Offset
MySQL provides a LIMIT clause that is used to specify the number of records to return. The LIMIT clause makes it easy to code multi page results or pagination with SQL, and is very useful on large tables. Returning a large number of records can impact on performance. Assume we wish to select all records […]
Way to upgrade PHP5 to PHP7
Enter the following commands in the order shown: sudo apt-get -y update sudo add-apt-repository ppa:ondrej/php sudo apt-get -y update sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0 php7.0-common php7.0-gd php7.0-mysql php7.0-mcrypt php7.0-curl php7.0-intl php7.0-xsl php7.0-mbstring php7.0-zip php7.0-bcmath php7.0-iconv Enter the following command to verify PHP 7.0.2 installed properly: php -v Following is a sample response that […]
mysqladmin to kill the runaway query
Run the following commands: mysqladmin -uusername -ppassword pr Then note down the process id. mysqladmin -uusername -ppassword kill pid
Is WordPress best for E-commerce?
Top 10 Reason why people are choosing wordpress
Why WordPress is a best CMS ?
WordPress Interview Questions
What is the difference between jquery position() and offset()?
<html> <body> <divid=”div1″style=”position:absolute; top:50px; left:50px”> <divid=”div2″> </div> </div> </body> </html> Both offset and position for body will return 0 and 0. Both offset and position for div1 will return 50 and 50. AND NOW THE INTERESTING PART Position for div2 will return top:0 and left:0 which would be relative to the parent in this case […]
How to add new tab to admin list of posts and handle result list
add_action(‘views_edit-post’,’remove_edit_post_views’);function remove_edit_post_views( $views ){ $views[‘pre’]='<a href=”‘.admin_url().’edit.php?pre=pre”>My Special Posts</a>’;return $views;} add_action(‘pre_get_posts’,’my_special_list’);function my_special_list( $q ){ $scr = get_current_screen();if( is_admin()&&( $scr->base===’edit’)&& $q->is_main_query()){// To target only a post type uncomment following line and adjust post type name// if ( $scr->post_type !== ‘post’ ) return;// if you change the link in function above adjust next line accordingly $pre = […]
Responsive Background-Image inside Div
html { background: url(images/bg.jpg)no-repeat center center fixed;-webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover; background-size: cover;}