Jump to content

Why still not insert the data into database


fansa

Recommended Posts

Hai everybody...i need help from brilliant person. What wrong with my coding,stilll not function (insert)???

if(isset($_POST['Register']))
{
   $_SESSION['ipa_id']     = $_POST['ipa_id'];
   $_SESSION['ifp_ic_to']  = $_POST['ifp_ic_to'];
       $_SESSION['ifp_ic_from']= $_POST['ifp_ic_from'];
       $_SESSION['ifp_season'] = $_POST['ifp_season'];
       $_SESSION['refno']      = $_POST['refno'];
   $_SESSION['ifp_company']= $_POST['ifp_company'];


   $iph_correction_cnames = array(ic_companyno,
                                  ic_refno,
				                  ic_is_id,
						          ic_org_id_01,
						          ic_din_id_01,
								  ic_org_id_02,
								  ic_din_id_02,
								  ic_created_date,
								  ic_created_by,
								  ic_process_status,
								  ic_status);


    $iph_correction_values = array($_POST['companyno'],
	                               $_POST['refno'],
								   $_POST['is_id'],
								   $_POST['org_id'],
								   $_POST['din_id'],
								   $_POST['org_idto'],
								   $_POST['din_idto'],
								   datetime(),
								   MXPRO_USR_ID,
									  'NEW',
								  'N');

	 $iph_correction_cnames = implode($iph_correction_cnames ,",");
         $iph_correction_values = implode($iph_correction_values,"','");				

  	 $insert01 = new myclass;
     $insert01 = $insert01->insert('iph_correction',$iph_correction_cnames,$iph_correction_values); 


    header("Location: ../../../../public_html/mxpro.master.php?mnd_code=mn_iph_27&ch=6");
    exit;
}

Link to comment
Share on other sites

Also, are any of these constants defined?

 

array(ic_companyno,
                                  ic_refno,
				                  ic_is_id,
						          ic_org_id_01,
						          ic_din_id_01,
								  ic_org_id_02,
								  ic_din_id_02,
								  ic_created_date,
								  ic_created_by,
								  ic_process_status,
								  ic_status);

Link to comment
Share on other sites

Still not work...this is the edited coding

if(isset($_POST['Register']))

{

    $_SESSION['ipa_id']    = $_POST['ipa_id'];

  $_SESSION['ifp_ic_to']  = $_POST['ifp_ic_to'];

      $_SESSION['ifp_ic_from']= $_POST['ifp_ic_from'];

      $_SESSION['ifp_season'] = $_POST['ifp_season'];

      $_SESSION['refno']      = $_POST['refno'];

  $_SESSION['ifp_company']= $_POST['ifp_company'];

 

 

  $iph_correction_cnames = array('ic_companyno',

                                  'ic_refno',

                  'ic_is_id',

          'ic_org_id_01',

          'ic_din_id_01',

  'ic_org_id_02',

  'ic_din_id_02',

  'ic_created_date',

  'ic_created_by',

  'ic_process_status',

  'ic_status');

 

 

    $iph_correction_values = array($_POST['companyno'],

                              $_POST['refno'],

  $_POST['is_id'],

  $_POST['org_id'],

  $_POST['din_id'],

  $_POST['org_idto'],

  $_POST['din_idto'],

  datetime(),

  MXPRO_USR_ID,

  'NEW',

  'N');

 

$iph_correction_cnames = implode($iph_correction_cnames ,",");

        $iph_correction_values = implode($iph_correction_values,"','");

 

  $insert01 = new myclass;

    $insert01 = $insert01->insert('iph_correction',$iph_correction_cnames,$iph_correction_values);

 

 

    header("Location: ../../../../public_html/mxpro.master.php?mnd_code=mn_iph_27&ch=6");

    exit;

}

Link to comment
Share on other sites

Still, you have supplied the arguments to implode around the wrong way.

 

$iph_correction_cnames = implode($iph_correction_cnames ,",");
$iph_correction_values = implode($iph_correction_values,"','");

 

should be.....

 

$iph_correction_cnames = implode(',', $iph_correction_cnames);
$iph_correction_values = implode(',' $iph_correction_values);

Link to comment
Share on other sites

This is the class

 

 

if(!empty($refno) && !empty($ifp_season))

{

 

$iph_refno= new myclass;

$iph_refno = $iph_refno->fetchdata("Select * from iph_correction where ic_refno='".$refno."'") ;

                                                       

$refno        = $iph_refno->ic_refno;

$ic_companyno  = $iph_refno->ic_companyno;

 

 

if($refno != $_SESSION['refno'] &&  $_GET['refno'] == '') {

header("Location: ../../../../public_html/mxpro.master.php?mnd_code=mn_iph_27&ch=6");?>

    <script type="text/javascript">alert("You need to register the reference number!!");</script><? }

elseif($ic_companyno== '' && $refno != $_GET['refno']) {

  ?>

    <script type="text/javascript">alert("You need to register the reference number!!");</script><? }

 

 

 

 

 

}

 

[attachment deleted by admin]

Link to comment
Share on other sites

Um, no its not.

 

And a correction to my earlier code (this is still guess work until we see some relvent code) should be....

 

$iph_correction_cnames = implode("','", $iph_correction_cnames);
$iph_correction_values = implode("','" $iph_correction_values);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.