0% found this document useful (0 votes)
4 views1 page

MySQL PHP Student Insertion Script

The PHP code connects to a MySQL database, inserts a row into the student table with values for name and dep, and checks if the insertion was successful or displays an error.

Uploaded by

shubh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

MySQL PHP Student Insertion Script

The PHP code connects to a MySQL database, inserts a row into the student table with values for name and dep, and checks if the insertion was successful or displays an error.

Uploaded by

shubh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

<?

php
$con = mysql_connect("localhost","root","");
if (!$con)
{
echo"Could not connect";
}
else
{
echo"Connected sucessfully <br/>";
}

mysql_select_db("vp11", $con);

$result = mysql_query("insert into student (name,dep) values('mohan','IT')");

if(! $result)
{
echo" could not created";
}
else
{
echo" 1 row inserted" ;
}
mysql_close($con);
?>

You might also like