pTutorial

New way to learn PHP

PHP 5 MYSQL Introduction

What is database?

The collection of data, usually referred to as the database, contain information relevant to an enterprise .The primary goal of a DATABASE is provide a way to store and retrieve data base information that is both convenient and efficient.

PHP is capable to connect database easily Connecting a database to the internet has never been so easy, PHP support many database like MySQL PostgreSQL, Oracle, Berkeley DB, Informix etc.

Now we will talk about MySQL Database

What is MySQL?

  • MySQL is a database server normally used with PHP.
  • Dynamic web pages can be generated with the help of PHP + MYSQL
  • MySQL is support both large and small applications
  • There is no memory leakage with MySQL
  • MySQL reduce database licensing cost
  • Its cuts the system downtime
  • Its reduce maintenance
  • Easily accessible

Simple example of database connectivity

<?php

error_reporting(0);
$host_name="localhost";
$user_name="root";
$password="";
$db_con=mysql_connect($host_name,$user_name,$password);
if($db_con)
{
echo"Successfully connected to the database ";
}
else
{
echo"Connectin fail";
}


?>

Advantage of MYSQL

There are two main advantages of MYSQL. It is relatively fast due to its simple structure and comes under the Open-Source License (for non-commercial use), so we can use freely.

MySQL can be downloaded from here http://www.mysql.com.

We are working with WAMP so we do not need to download database explicitly because WAMP have already embed.


QUOTES OF THE DAY

Beauty is truth, Truth beauty- That is all

LIKE ON FACEBOOK

+1 ON GOOGLE

SHARE ON TWITTER