lundi 28 septembre 2015

How to fix this error "Notice: Undefined offset" and save records to database?

I'm working on fee management system and getting error "Notice: Undefined offset"

Notice: Undefined offset: 32 in H:\USB-Server\root\include\PayFee.php on line 14
Notice: Undefined offset: 1 in H:\USB-Server\root\include\PayFee.php on line 17
Notice: Undefined index: 7-H in H:\USB-Server\root\include\PayFee.php on line 20
Notice: Undefined offset: 0 in H:\USB-Server\root\include\PayFee.php on line 23
Notice: Undefined index: 2015-09-02 in H:\USB-Server\root\include\PayFee.php on line 26
Notice: Undefined index: Cash in H:\USB-Server\root\include\PayFee.php on line 29
Notice: Undefined index: dffd in H:\USB-Server\root\include\PayFee.php on line 32
Notice: Undefined index: 2015-09-23 in H:\USB-Server\root\include\PayFee.php on line 35
Notice: Undefined offset: 1000 in H:\USB-Server\root\include\PayFee.php on line 38
Notice: Undefined variable: fee_concession in H:\USB-Server\root\include\PayFee.php on line 41
Notice: Undefined index: in H:\USB-Server\root\include\PayFee.php on line 41
Notice: Undefined offset: 0 in H:\USB-Server\root\include\PayFee.php on line 44
Notice: Undefined offset: 0 in H:\USB-Server\root\include\PayFee.php on line 47
Notice: Undefined offset: 0 in H:\USB-Server\root\include\PayFee.php on line 50
Notice: Undefined offset: 1000 in H:\USB-Server\root\include\PayFee.php on line 53

 

And also whenever i'm trying to save records in database it save as in following picture

enter image description here

And i'm using following codes:-

if(isset($_REQUEST['submit']))
{
$errorMessage = "";
$s_student_id = mysql_real_escape_string($_POST['studentID']);
$student_id = $_POST[$s_student_id];
$s_school_id = mysql_real_escape_string($_POST['schoolID']);
$school_id = $_POST[$s_school_id];
$s_fee_classsec = mysql_real_escape_string($_POST['classID']);
$fee_classsec = $_POST[$s_fee_classsec];
$s_fee_status = mysql_real_escape_string($_POST['feeStatus']);
$fee_status = $_POST[$s_fee_status];
$s_fee_dueDate = mysql_real_escape_string($_POST['fee_dueDate']);
$fee_dueDate = $_POST[$s_fee_dueDate];
$s_fee_mode = mysql_real_escape_string($_POST['fee_mode']);
$fee_mode = $_POST[$s_fee_mode];
$s_fee_info = mysql_real_escape_string($_POST['fee_info']);
$fee_info = $_POST[$s_fee_info];
$s_fee_paidDate = mysql_real_escape_string($_POST['fee_paidDate']);
$fee_paidDate = $_POST[$s_fee_paidDate];
$s_fee_amount = mysql_real_escape_string($_POST['fee_amount']);
$fee_amount = $_POST[$s_fee_amount];
$s_fee_concession = mysql_real_escape_string($_POST['fee_concession']);
$fee_concession = $_POST[$fee_concession];
$s_fee_lateCharges = mysql_real_escape_string($_POST['fee_lateCharges']);
$fee_lateCharges = $_POST[$s_fee_lateCharges];
$s_fee_vat = mysql_real_escape_string($_POST['fee_vat']);
$fee_vat = $_POST[$s_fee_vat];
$s_fee_serviceTax = mysql_real_escape_string($_POST['fee_serviceTax']);
$fee_serviceTax = $_POST[$s_fee_serviceTax];
$s_fee_grandTotal = mysql_real_escape_string($_POST['fee_grandTotal']);
$fee_grandTotal = $_POST[$s_fee_grandTotal];
$insqDbtb = "INSERT INTO fee_info (
student_id, 
school_id, 
fee_status, 
fee_classsec, 
fee_due_date, 
fee_paid_date, 
fee_amount, 
fee_late_charges, 
fee_concession, 
fee_vat, 
fee_service_tax, 
fee_total, 
fee_mode, 
fee_info) 
VALUES ('$student_id',
'$school_id',
'$fee_classsec',
'$fee_status',
'$fee_dueDate',
'$fee_paidDate',
'$fee_amount',
'$fee_lateCharges',
'$fee_concession',
'$fee_vat',
'$fee_serviceTax',
'$fee_grandTotal',
'$fee_mode',
'$fee_info')";
mysqli_query($link,$insqDbtb) or die(mysqli_error($link));
echo 'Record saved...';
}

Anyone can help me to fix this issue? I didn't recognize the issue :(




Aucun commentaire:

Enregistrer un commentaire