MySQL Create Table

by Yogesh Khanna 11-Jun-16

0 959


MySql Create Table: The statement used to create a table in MYSQL is: CREATE TABLE

Syntax:
CREATE TABLE table_name(
column1 VARCHAR(25) NOT NULL,
column2 VARCHAR(25) NOT NULL,
column3 VARCHAR(25) NOT NULL
);

First connect to the database and then create a table.

For Example:

<?php

$connect=mysql_connect("servername","username","password"); OR die ("connection failed");
$db=mysql_select_db("database_name",$connect);

CREATE TABLE table_name(
id INT(11) AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(25) NOT NULL,
city VARCHAR(25) NOT NULL
);

?>
For any issue and query you can feel free discuss to us, we always happy to serve you.. Please send your queries on below comment box.

Share:


Discount Coupons



Comments

    Waiting for your comments

Leave a Reply