Don't like ads? PRO users don't see any ads ;-)

fungsi untuk mendapatkan id

By: GWibisono on May 6th, 2012  |  syntax: PHP  |  size: 0.26 KB  |  hits: 47  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         function id()
  2.         {
  3.                 $q=$this->db->query('select * from my_id');
  4.                 $r=$q->result_array();
  5.                 $id0=$r[0]['id'];
  6.                 $id1=$id0+1;
  7.                 $a=array('id'=>'');
  8.                 $q=$this->db->query("UPDATE   `my_id` SET  
  9.                 `id` =  '$id1' WHERE   `id` =$id0");
  10.                 return $id1;
  11.                
  12.         }