MySql Create Table

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.


Coding Tag

Coding Tag always happy to serve you in Information Technology (IT). Learn HTML, CSS, Javascript, PHP, Android, Digital Marketing, Latest IT News and many more.

Leave a Reply

avatar
  Subscribe  
Notify of