Linksys Classes PHP Introduction Insert data Display and Delete Data in mysql using PHP

Опубликовано: 21 Май 2026
на канале: Deepak Prajapati
301
8

This Video will help the students to enable their php knowledge to insert data in Mysql database using PHP Page in simple Language.
Using this Video students can learn how to insert data in mysql table using php code as well as Display data and remove data from Mysql table

Here is the Sample PHP Code :
mysql_connect('localhost','root','');
mysql_select_db('test');
if(isset($_POST['btnSave'])){
$name=$_POST['txtName'];
$email=$_POST['txtEmail'];
$mobile=$_POST['txtMobile'];
$query="insert into info values(0,'$name','$email','$mobile')";
if(mysql_query($query))
echo "Inserted Successfully";
else
echo "Error in Insert";
}
if(isset($_GET['delete']))
{
$id=$_GET['delete'];
// delete from info where id=id
$query="delete from info where id=$id";
mysql_query($query);
header('location:index.php');
}