fansa Posted December 23, 2008 Share Posted December 23, 2008 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; } Quote Link to comment Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 Your supplied arguments to implode are around the wrong way for starters. Quote Link to comment Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 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); Quote Link to comment Share on other sites More sharing options...
fansa Posted December 23, 2008 Author Share Posted December 23, 2008 I don't understant what you mean..please help me... Quote Link to comment Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 Well then, its likely you meant those values to be strings. Change them to.... array('ic_companyno', 'ic_refno', 'ic_is_id', etc etc. Quote Link to comment Share on other sites More sharing options...
fansa Posted December 23, 2008 Author Share Posted December 23, 2008 ok..i'll try now Quote Link to comment Share on other sites More sharing options...
fansa Posted December 23, 2008 Author Share Posted December 23, 2008 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; } Quote Link to comment Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 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); Quote Link to comment Share on other sites More sharing options...
fansa Posted December 23, 2008 Author Share Posted December 23, 2008 Still not work :'( Quote Link to comment Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 Can we see the insert method of myclass ? Quote Link to comment Share on other sites More sharing options...
fansa Posted December 23, 2008 Author Share Posted December 23, 2008 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] Quote Link to comment Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 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); Quote Link to comment Share on other sites More sharing options...
fansa Posted December 23, 2008 Author Share Posted December 23, 2008 owh..i don't know what happen with this coding..still not work..suppose work..arghhhh Quote Link to comment Share on other sites More sharing options...
trq Posted December 23, 2008 Share Posted December 23, 2008 We need to see the insert method of this myclass class. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.