Monthly Archives: April 2016

Difference Between mysql and mysqli

Hi all,
Yesterday I attend the telephonic interview to web development post. The interviewer ask somany questions related to PHP, MYSQL, WordPress, JavaScript, jQuery etc. Almost every questions I answerd. But the interviewer ask one important question What is the Difference Between mysql and mysqli. I can’t give the correct answer to him. Here I share useful information related to this topic.




The mysql is the old extension. The mysqli is an improvement over the old extension of mysql. The i in mysqli stands for improved . Mysqli has many advantages and features available than mysql.

Key benefits of mysqli over mysql extension

  1. mysqli over mysql, benefits of mysqli: Since MySQL 4.0, there is a library available that can be used to run a complete MySQL server embedded inside a program, usually a desktop application.



  2. Object-oriented interface: Mysqli support object oriented concept. The OOPs concept support only mysqli.
  3. Enhanced debugging capabilities: For save debugging information into a file using mysqli_debug(…).
  4. Prepared Statements: The mysqli prevent SQL Injection and also helps to excecute faster.
  5. Support for Transactions: This is really useful to write robust applications. It gives you the ability to write a group of SQL statements that will either be executed or all rolled back



  6. Multiple Statements: With this “feature”, you can execute multiple SQL queries inside only one “mysqli” call. This reduces the round trips between the database server and the PHP server

If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

How to Get the URL of Images You Upload – WordPress

Hi all,
In wordpress we can add the image in wordpress post or wordpress page. And in this article describe how to get the uploaded image url through wordpress dashboard.
For this operation first login wordpress dashboard using wp username and password.



How to get the url of image from Media Library

Getting the image url from Media Library, first login the dashboard and select the media from wp-admin then we can see the uploaded media library. Like below:

image_url1



Getting the image url, select one image from media library then you can see the details with url, File name, File type, Uploaded on, File size, Dimensions etc.

image_url2



You can see the link URL of the image you uploaded from your computer to WordPress. Now all you have to do is copy that URL and use it wherever you like. Whether it is Facebook, twitter or anywhere else.

If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

Difference Between Posts vs. Pages in WordPress

There are some key differences between pages and post in your WordPress sites. After install wordpress you’ll see two important items on your dashboard: Posts and Pages.



What’s in a Page?

Pages do not support tags or categories. Pages are static and are not listed by date. An About page, Privacy Policy Page and Terms and conditions are the classic example.
Pages are not associated with a time/date like posts, nor can you categorize or tag a page. You can arrange sub-pages under parent- pages.




Create a New Page

There are two ways to create a new page. You can click Pages -> Add New in your dashboard. Or you can hover over + New in the admin bar and select Page from the dropdown menu.

Edit a Page




If you would like to edit an existing page, click Pages -> All Pages on the left menu. Under the page you’d like to edit, click on the Edit link.

What’s in a Post?

Posts can be found in the Categories, Archives, Recent Posts, and other widgets. Posts are also displayed in the RSS feed of the blog. You can control how many posts are displayed at a time in the Reading Settings.

Posts vs. Pages (Key Differences)

  1. Posts are timely vs. Pages are timeless.
  2. Pages have custom template feature vs. Posts do not.



  3. Posts are social vs. Pages are NOT.
  4. Posts are included in RSS feed vs. Pages are not.
  5. Posts can be categorized vs. Pages are hierarchical.

If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

How to Properly Uninstall a WordPress Plugin

Hi all,
Today we discuss how to uninstall wordpres plugins using wordpress dashboard or wordpress admin area. Thousands of free and paid wordpress plugins are available. If you want to uninstall wordpress plugins first install wordpres plugin in ‘wp-content/plugins’ directory.




You can easily install wordpress plugins into your sites. To uninstall a plugin from your WordPress blog, follow these steps:

Step 1: Find the installed Plugins in Plugin menu in wordpress dashboard.
The Plugins page opens.

uninstall_plugin1



Step 2: Locate the plugin you want to uninstall

uninstall_plugin2



Step 3:Click the Deactivate link below the plugin title.
uninstall_plugin3




The Plugins page refreshes, and the plugin now appears as deactivated (or inactive).

Step 4:Click the Delete link that now appears below the plugin title.
uninstall_plugin4




The Delete Plugin page opens, and a confirmation message displays asking you whether you’re sure you want to delete this plugin.

Step 5 : Click the Yes, Delete These Files button.
uninstall_wordpress_plugins5




The Plugins page refreshes, and the plugin you just deleted is gone from the lists of plugins, with a message displayed at the top confirming the deletion of the plugin.

Difference Between Deactivating and Uninstalling a WordPress Plugin

All wordpress users, simply going to a plugins page and deactivating plugins that they don’t want to use.
If you deactivating the wordpress plugins, it is not permanently deleting. We can easily re-activated the deactivating plugins easily. Because the plugins files are available in plugin directory.

uninstall_wordpress_plugins6



If you want uninstall a plugins first deactivating the plugins and delete the plugin from directory( Refere Step 4 and Step 5).

Removing Unused Shortcodes in WordPress

Almost every wordpress plugins uses the shortcode for performing plugins features into your post or pages.
Many WordPress plugins use shortcodes to add things into your posts or pages. Once you uninstall or deactivate a plugin, those shortcodes will become visible in your posts.

[pluginshortcode]



You can easily disable shortcodes by adding this code in your theme’s functions.php file or a site-specific WordPress plugin.


add_shortcode( 'pluginshortcode', '__return_false' );




If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

How to Install a WordPress Plugin – Step by Step for Beginners

Hi all,
Today I share how to install wordpress plugin using different method. For install wordpress plugin first install wordpress in a directory. After install wordpress, the first thing every beginner needs to learn is how to install a WordPress theme.




We can install wordpress theme through wordpress dashboard or cpanel directory( wp_content/ theme directory).

Next, we focus how to install wordpress plugin. Every beginners needs to know how to install a wordpress plugin.
Plugin helps to add more features in our applications easily. It provide more functionality like add gallery, facebook plugins, Crayon Syntax Highlighter,slideshow plugins etc.
There are thousands of free and paid plugins are available in wordpress directory.
In here step by step guide, we will show you how to install a WordPress plugin.




How to Install a WordPress Plugin

We can install wordpress plugin using three method. They are:

  1. Search and Install Plugin from WordPress Dashboard
  2. Uploading a WordPress plugin



  3. manually installing a WordPress plugin using FTP.

Method 1: Search and Install Plugin from WordPress Dashboard

The easy way of installing a WordPress plugin by using the plugin search. The only downside of this option is that a plugin must be in the WordPress plugin directory which is limited to only free plugins.
First thing you need to do is go to your WordPress admin area and click on Plugins » Add New.

wordpress_plugins



Find the plugin by typing the plugin name or the functionality you are looking for, like we did. After that, you will see a bunch of listings like the example below:

wordpress_plugins1



WordPress will now download and install the plugin for you. After this, you will see the success message with a link to activate the plugin or return to plugin installer.

wordpress_plugins2



The next step is to configure the plugin settings. These settings will vary for each plugin therefore we will not be covering that in this post.

Method 2 :Install a Plugin using the WordPress Admin Plugin Upload

First, you need to download the plugin from the source. Next, you need to go to WordPress admin area and visit Plugins » Add New page. After that, click on the Upload Plugin button on top of the page.

wordpress_plugins3



This will bring you to the plugin upload page. Here you need to click on the choose file button and select the plugin file you downloaded earlier to your computer.

Method 3:Manually Install a WordPress Plugin using FTP

WordPress plugins are the tools which provide additional functionality to your application. To install wordpress plugin first plugin put into ‘wp-content/plugins’ directory. Once the plugin is installed, you may activate it or deactivate it from the Plugins menu in your WP administration login(worpress dashboard).

step1_wordpress_plugin



The Plugins are put into wp-content/plugins directory, activate it from the administrator backend (wordpress dashboard).

step2_wordpress_plugins



In WordPress 2.7 and above you can install plugins directly from the admin area. Download the plugin to your computer, log in to your WP admin area and go to Plugins and Add New. Browse to the plugin archive and select it. Then click Install now and the plugin will be installed shortly.

step3_wordpress_plugin



For remove wordpress plugin, simply remove the directory for the plugin you would like to uninstall and it will be automatically deactivated.

If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

Multiple WordPress Installation Using a Single Database

Hi all,
Here I explain how to install multiple wordpress in a single database. If you want multiple sites, multiple theme in one database. You must install WordPress manually in order for this to work. Most one click programs like Fantastic would not let you choose the prefix.



Multiple Blogs Through Multiple Installs

We can develope the multiple wordpress site with multiple database. System architecture can be divided into two types by number of databases.

  1. Multiple databases installation. The each database manage site’s information.
  2. Single database installation. The database manages all site’s information into one database .

Multiple Databases

You’ll need a separate MySQL database for each blog you plan to install.The wp-config.php file will vary for each installation. The lines to change are:




multiplesite_onedb



DB_NAME will be the name of the individual database created for that blog. If you are using different user logins for each database, edit DB_USER and DB_PASSWORD to reflect this, as well.

Single Database

In above, explain we can use multiple wordpress site with multiple database access. But in here how to use multiple wordpress sites with single database.
In this case, only one line will be unique in each blog.


$table_prefix = 'wp_'; // example: 'wp_' or 'projects' or 'mylogin_' or 'test'

Edit the wp-config.php page like this:

table_prefix = ‘wp1_’;
table_prefix = ‘wp2_’;
table_prefix = ‘wp3_’;




By default, WordPress assigns the table prefix wp_ to its MySQL database tables, but this prefix can be anything you choose. By using more than one, you create unique identifiers for each blog in your database. For example, let’s say you have three blogs to set up, with the names Main, Projects and Test. You want to substitute the prefix wp_ for each blog’s wp-config.php:

Main blog:

$table_prefix = 'main_';

Page blog:

$table_prefix = 'page_';

Test blog:

$table_prefix = 'testing_';

That is all you really need to do. This is also a security measure that you can take even if you don’t have to install multiple installation. By having a prefix, you are making the hacker work more to find out what is the SQL Address before he can hack.

If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.