<?php
$con=mysqli_connect("localhost","root","","trial");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
if(isset($_POST['submit']))
{
$billno=$_POST['billno'];
$doa=$_POST['doa'];
$dod=$_POST['dod'];
$dbcd=$_POST['dbcd'];
$acno=$_POST['acno'];
$dosub=$_POST['dosub'];
$suby=$_POST['suby'];
$dop=$_POST['dop'];
$credate=$_POST['credate'];
$paytype=$_POST['paytype'];
$sql="UPDATE cust SET doa ='$doa', dod = '$dod', dbcd='$dbcd', acno='$acno', dosub='$dosub', suby='$suby', dop='$dop', credate='$credate'
** WHERE billno = '$billno'";**
print $sql;
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
}
echo "1 record edited";
mysqli_close($con);
?>
my data base (cus) is not getting updated as the bill no while for WHERE clause gives a blank space before and after the fetched result