Insert ID for 5 items or More
===

I continued from the previous topic that I discuss.

    http://stackoverflow.com/questions/11680950/1-id-for-more-items

In that last topic, I ask about the concept and now what I'm doing is continue to coding concept.

The code successfully save the data into database, but still when insert 5 item, it submit the data per item per ID. Example :<br>
Item 1 - Computer (Purchase No 1)<br>
Item 2 - Mouse (Purchase No 2)<br>
That I wanted is :<br>
Item 1 - Computer (Purchase No 1)<br>
Item 2 - Mouse (Purchase No 1)

and here it's my code : I using purchase no with autoincrement.

Here it's my execute code :

    <?php
    $conn = oci_connect("system", "dev01");
    $n = $_POST['jum'];
    for ($i=1; $i<=$n; $i++)
    {
    $dept=$_POST['dept'];
    $date_request=$_POST['date_request'];
    $supplier=$_POST['supplier']; 
    $item=$_POST['item'.$i]; 
    $qty=$_POST['qty'.$i];  
    $uprice=$_POST['uprice'.$i]; 
    $total=$_POST['total'.$i];  
    $s = oci_parse($conn,
    "insert into purchase_request(dept_id, supplier_id, date_request, item, qty, uprice, total_amount) values ('$dept', '$supplier', '$date_request', '$item'
    , '$qty', '$uprice', '$total'

    )");

    $r = oci_execute($s);
    oci_rollback($conn);
    echo "Data was committed\n";
    }
    ?>

  Any suggestions ?
   

   









