Database connection code
<?php
/*Connect Database*/
$conn = mysqli_connect('localhost','root','') or die(mysqli_error());
/*Select Database*/
$select_db = mysqli_select_db($conn,'practise') or die(mysqli_error());
?>
<?php
//Database connection
include("includes/dbconnet.php");
//Insert data into database
$name=$_POST['name'];
$email=$_POST['email'];
$telephone=$_POST['telephone'];
$subject=$_POST['subject'];
$mesg=$_POST['mesg'];
//Sql Query to Insert Data in table
$sql="INSERT INTO pract SET name='$name',
email='$email',
telephone='$telephone',
subject='$subject',
mesg='$mesg'";
/*Execute Query*/
$result=mysqli_query($conn,$sql) or die (mysqli_error());
if($result==true)
{
header('location:index.php?success');
}
else
{
echo "Error";
}
?>
Error message received
Warning: mysqli_error() expects exactly 1 parameter,
Please kindly help to fixed the error