Hi,
I am trying to insert data to the database , but i could not successful . Please help me to find outh the error in my code.

<?php
$action=$_REQUEST['action'];
if($action=="insert")
{
$customer_name=$_POST['customer_name'];
$plan_opted=$_POST['plan_opted'];
$Payment_Mode=$_POST['Payment_Mode'];
$customer_id=$_POST['customer_id'];
$Plan_term=$_POST['Plan_term'];
$cheque_no=$_POST['cheque_no'];
$l_f_no=$_POST['l_f_no'];
$payment_frequency=$_POST['payment_frequency'];
$cheque_date=$_POST['cheque_date'];
$agent_name=$_POST['agent_name'];
$inst_amount=$_POST['inst_amount'];
$agent_code=$_POST['agent_code'];
$date_commencement=$_POST['date_commencement'];
$late_fee=$_POST['late_fee'];
$paid_till_date=$_POST['paid_till_date'];
$instalment_no=$_POST['instalment_no'];
$misc_charges=$_POST['misc_charges'];
$receipt_no=$_POST['receipt_no'];
$date22=$_POST['date22'];
$Place=$_POST['Place'];


$query5="INSERT INTO money_receipt SET customer_name='$customer_name', plan_opted=$'plan_opted', $Payment_Mode=$'Payment_Mode',customer_id=$'customer_id',
Plan_term=$'Plan_term', cheque_no=$'cheque_no', l_f_no=$'l_f_no', payment_frequency=$'payment_frequency', cheque_date=$'cheque_date', agent_name=$'agent_name', inst_amount=$'inst_amount',agent_code=$'agent_code', date_commencement=$'date_commencement', late_fee=$'late_fee',paid_till_date=$'paid_till_date',instalment_no=$'instalment_no', misc_charges=$'misc_charges',receipt_no=$'receipt_no',date22=$'date22',Place=$'Place'";

$result5=mysql_query($query5);
}
?>

Recommended Answers

All 3 Replies

Member Avatar for rajarajan2017

Every place you have to change instead of

Place=$'Place'

with

Place='$Place'

Look at $ symbol where you placed.

Member Avatar for rajarajan2017

If it is solved, Mark as Solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.