Insert Data in MySQL Database

by Yogesh Khanna 13-Jun-16

0 594


Insert Data in MySQL Database !!

As you read, How to Create Data. Now there is insertion Syntax after creating DATABASE. 'INSERT' statement is used to insert data into table.

Code:

<?php

$sql="INSERT INTO student(name, emailid, city) VALUES('Vihaan','vihaan@codingtag.com','Delhi')";

// student is table name

if ($sql)
{
echo "Record Created Successfully";
}
else
{
echo "Insertion Failed";
}

?>


Share:

Comments

    No Comments Yet.

Leave a Reply