Advertisement
GWibisono

multiple insert

May 6th, 2012
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.22 KB | None | 0 0
  1. <?php
  2. $id=cari_id();
  3. $a=array(
  4. "insert into table1 values($id,now())",
  5. "insert into table2 values($id,'nama pejabat','partai')",
  6. );
  7.  
  8. foreach($a as $sql){
  9.     $r=mysql_query($sql) or die("$sql<hr>".mysql_error());
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement