Category: PHP

Selecting database using alternative methods in PHP

Most of the time we use mysql_select_db() to select a mysql database, the syntax is mysql_select_db( db_name, connection ); The above syntax results a boolean value, i.e. either true (1) or false(0). Alternatively, you can use MySQL command: USE database_name Let me show you how to use it with PHP. You can implement the above

Read More

Making PHP login more secure with some tweaks in MD5 hashing

There are several methods to make your login script secure. The most crucial step for that is obviously to escape strings using real_escape_string() function that varies from the PHP version. This will get you rid of some common SQL injection attacks via form or address bar. Another thing you must make secure is the user password.

Read More

How to access WordPress Database Away from WordPress Root

WordPress by defauly supports globally announcing $wpdb to access the WordPress. But in case you are away from the WordPress root you’ll need to redefine the database information to access WordPress. Again after accessing the database you may need to redefine the database prefix, which will really eat your time and dynamic ability of your

Read More

Enter Unicode characters in MySQL

PHP 5 and MySQL 4.1 supports UTF-8 natively (without special compilation options) . However one must take care if the data is stored properly and can be viewed properly. In this tutorial, I am going to guide you to input unicode characters and fetch it out in MySQL 4.1+ version using PHP 5. MySQL has

Read More

Creating your own WordPress like blog using PHP & MySQL- Basic

Today in my blockbuster tutorial, I am going to teach you how to create your own dynamic (Content management system) blog website. Before beginning, let me tell you the basic skills  you’ll need: CSS JavaScript (optional) PHP MySQL HTML Let’s categorize the jobs to be done to make perfect, or at least, good CMS. Basic

Read More