How to Connect to Mysql Database


To access the database tables from mysql you need to make connection with database. To complete this task you can use mysql_connect() function.

To do this in php language through. Choose your favorite Editor (Note Pad, Dreamweaver etc) then create a php file called connect.php. Now Inside connect.php file you apply below written codes.

Example :

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Not Successful Connected to Database ' . mysql_error());
  }

// Here is your codes Like Display Information from Database or Edit information etc.

?>

Now you saw the codes where $con is a connection variable which hold the all connection information. In mysql_connection() a localhost is server name that show above script run on local server and next two places are username and password where root is default username of mysql and password is by default null. If condition check the if variable $con hold not hold right information about connection then display message “Not Successful Connected to Database”. Next part is where you write your own script codes for data manipulation.
Share:

Why Wordpress? Wordpress Features Make WordPress Rocks!

WordPress being fastest growing CMS. Accordding estimate thosunds of new sites being developed world wide daily in the top 10 million websites. WordPress being the blogging platform employed by all of the bloggers by themselves domain. Some use other blogging software as well, but WordPress is most popular. The explanation for so much popularity of WordPress is nothing other compared to the distinguishing features it offers.

Glance at Wordpress several key benefits, through to create ecommerce or personal site.

Flexible : Three steps installation, user friendly interface and abundance of available tutorials make it the easiest blogging software to use.

Besides that it allows maximum customization, i.e. you can customization in whatever the way you want.

SEO: Friendly: Simple and customized [search engine friendly]URL structures, tags and sitemaps etc make a blog noticed more by search engines, and this is all what WordPress provides.

Availability Of Variety Of Designs & Plugins: One of the major advantage is the widely available plugins and themes, that make a newbie an expert even.

Spam Control: The best feature of WordPress is that in association with Akismet, it provides the best spam control. In case if your domain is hit by spammers and you’re using WordPress, you don’t need to worry at all.

More than just a blog: WordPress Can Not Only Be Used For Blog, but also for a variety of purposes. It’s not only a blog but serves as a CMS [Content Management System], i.e. a news site etc.

There may be many other benefits that WordPress offers, but for that you must have to use it, you’ll get an idea yourself that what you can make of it!
Share: