0

Hi friends

Please help me it is out of my head, I am pussing date and other variables value through url. Some time date is entering correctly in date field and some time entering 000-00-00.

Please help me out.

<?php
include '../require.php';

$date=mysql_real_escape_string($_REQUEST['id']);

$app_id=$_REQUEST['app'];
$branch=$_REQUEST['branch'];
$ins=$_REQUEST['ins'];
$ins=$ins+1;
//echo $app_id;
//$rr="select * from 013client where client_id='$app_id'";
//echo $rr;
$er=mysql_query("select * from 013client where client_id='$app_id'");
$re=mysql_fetch_array($er);
$prd_type=$re['prod_type_id'];

$prd_id=$re['product_id'];
if($prd_type==1)
{
    $total_amount=$re['monthly_mis'];
    $recpt_no="MIP".rand(1000000000,9999999999);
}
else
{
    $total_amount=$re['amount'];
    $recpt_no="MIPB".rand(1000000000,9999999999);
}
$ag_id=$re['agent_id'];
$dt_by=$date;
$duration=fetchreturn('duration','004add_product','id',$prd_id);

$rs=mysql_query("insert into 018renewal values('',$prd_type,$prd_id,'$app_id','$date',$total_amount,'paid','$dt_by','$branch',$ins)");


if($prd_type==1)
{
$tr=mysql_query("insert into print_details values('',$prd_type,$prd_id,'$app_id','cash','$branch','$recpt_no','$dt_by','$date','mipvoucher')");
}
else
{
$tr=mysql_query("insert into print_details values('',$prd_type,$prd_id,'$app_id','cash','$branch','$recpt_no','$dt_by','$date','renewal')");
}
?>
Attachments 1.jpg 108.3 KB 2.jpg 158.33 KB
3
Contributors
3
Replies
13
Views
4 Years
Discussion Span
Last Post by AARTI SHRIVAS
0

If you get 0000-00-00 it means it was either not set, or invalid. You'll have to make sure the format is 'yyyy-mm-dd'

0

insert into 018renewal values('',2,25,'100404','2013-2-30',300,'paid','2013-2-30','HEAD_OFFICE',5)

check this i think it is

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.