WordPress AJAX login in sidebar without a plugin – Part I (Login)

In this AJAX login articles series we will implement best-practice techniques to provide Ajax login/logout mechanism for WordPress that will be available in sidebar.

By following this article you will be able to create a nice login box that resides in widget sidebar of your website and checks for user credentials and behaves accordingly .

Read More

Sum of multiple columns values in a row

With help of the following simple query you can find sum of multiple columns values in a row.

In the `marks` table below we have roll number and marks of each student in physics, chemistry and maths. Now we wish to find sum of marks obtained by each student.

Read More

Moving the Sharing and Like buttons in Jetpack

In our WordPress blogs, the Sharing and Like buttons in Jetpack get printed at the end of the the_content() Loop function, which causes them to display at the end of our post’s text by default. But that may not be where we want them in our site’s design.

Read More

Add a default image to Jetpack if no image present in a post

Here is a code snippet to add a default image to Jetpack if no image present in our post and we wish that image to be used by Jetpack to publicize our post.
Jetpack crawls the post and looks for images that can be used when sharing that post on Facebook, on Twitter. It starts by looking for a featured image.

Read More

Setting up foreign key in phpMyAdmin

Setting up foreign key in phpMyAdmin is quite easy. With help of this step by step pictured tutorial, you will be able to set foreign keys within your tables.
Here in the example we have three tables. ‘products’, ‘category’ and ‘product_category’. You can see structures of these tables in the picture below:

Read More

Retrieving the last record in each group

Many times we need to retrieve the last record in each group while working with database. Here group is set of those rows which have a identical column value.
You can use a ‘GROUP BY‘ to obtain the result but query with ‘LEFT JOIN‘ performs far better.

Read More

DATETIME or TIMESTAMP – Comparison

MySQL has DATETIME and TIMESTAMP fields to store date & time in MySQL database. There are some points that should be keep into mind while choosing data type to store date and time. DATETIME or TIMESTAMP? Let’s compare.

Read More

[ Page 15 of 18 ]