I am getting an error that "y is undefined variable".
I know this will gonna be so simple and basic problem but I am new to php so that's why I am facing this problem.
please me its urgent for me.
I know this will gonna be so simple and basic problem but I am new to php so that's why I am facing this problem.
please me its urgent for me.
Code:
<?php $Amtoffirstrelease=$_POST['Amtoffirstrelease']; $Amtofsecondrelease=$_POST['Amtofsecondrelease']; $head=$_POST['head']; $subhead=$_POST['subhead']; $Availableamt=$Amtoffirstrelease+$Amtofsecondrelease; $sanctionedamt=$_POST['sanctionedamt']; $progressivebal=$y+$sanctionedamt; $dbhost = "localhost"; $dbuser = "root"; $dbpass = ""; $dbname = "purchase"; mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname) or die(mysql_error()); $x="SELECT MAX(progressivebal) FROM 'naipone'"; $y= mysql_query("SELECT progressivebal FROM 'naipone' WHERE progressivebal=x") or die('error'); $query="insert into naipone(Amtoffirstrelease, Amtofsecondrelease, head, subhead, Availableamt,sanctionedamt,progressivebal) values ('$Amtoffirstrelease','$Amtofsecondrelease','$head','$subhead','$Availableamt','$sanctionedamt','$progressiveba l')"; mysql_query($query)or die('error'); echo"database update with:" .$Amtoffirstrelease."" .$Amtofsecondrelease. "".$Availableamt."" .$head."". $subhead.""; ?>
Comment