Showing posts with label php/mysql. Show all posts
Showing posts with label php/mysql. Show all posts
Today I'm going to explain about how to connect to database using PHP and how to create databases etc

First connect to localhost
mysql_connect("localhost","username","password") or die(mysql_error());
second:create a database
$query=mysql_query("CREATE DATABASE databasename");
if($query)
{
echo "database created";
}
else
{
die(mysql_error());
}
Now we can create table under database

$query1=mysql_query("CREATE TABLE tablename(column_name datatype definition1 definition2,column_name datatype definition1 definition2");
if($query1)
{

echo "table createed";

}
else
{
die(mysql_error());
}

Popular Posts

Blogger templates

Blogger news

Blogroll

Navigation

Total Pageviews

Powered by Blogger.

Labels

About Me hi this is chandrasekhar completed B.Tech in 2012.I like blogging

Labels

Labels

Blogroll

Featured Post (Slider)

About

Contact us

Combine

Horizontal

Vertical1

Channels

Categories

Channels

Gallery

Vertical2

Portfolio

Contact Form

Name

Email *

Message *

Tags

Most Trending

Top 10 Articles