Advertisement
GWibisono

non ci

Oct 28th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /*
  3. insert
  4. =================================
  5. Task Helper berisi
  6. * insert tugas ke table
  7.  
  8. =================================
  9. */
  10. function taskInsert($data,$type)
  11. {    
  12.     $arType=array('t_type'=>$type);
  13. /*
  14. title, from, to, contents
  15. $data=array(
  16.   'title'=>xxxx,
  17.   'from'=>xxx etc,
  18.   'to'=>xxxx,
  19.   'contents'=>xxx
  20. );     
  21. */ 
  22.  
  23.     $arType['t_detail']=json_encode($data);      
  24.  
  25.     foreach($arType as $n=>$v) $$n=addslashes($v);
  26.     $sql="insert into task (t_type,t_detail) values ('$t_types','$t_detail')";
  27.    
  28.  
  29. }//function taskInsert($data,$type)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement