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; } Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/ 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. Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-721962 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); Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-721964 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... Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-721974 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. Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-721977 Share on other sites More sharing options...
fansa Posted December 23, 2008 Author Share Posted December 23, 2008 ok..i'll try now Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-721978 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; } Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-721982 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); Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-721986 Share on other sites More sharing options...
fansa Posted December 23, 2008 Author Share Posted December 23, 2008 Still not work :'( Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-721991 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 ? Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-721999 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] Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-722008 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); Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-722016 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 Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-722023 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. Link to comment https://forums.phpfreaks.com/topic/138109-why-still-not-insert-the-data-into-database/#findComment-722025 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.