-2

I have a form where a user selects a company and a date. Then the user needs to select some inventory from a database and add the records id to an array for later use. My idea is to simply get the id of each inventory item and pass that to an array so then I can loop through that later to insert into mysql. I would like to be able to have the user search for an inventory from a field, then the results display below that field and then the user can select that specific inventory item. When they click/select it then it will add that records id to an array that I can play with later.

<form action="" method="post">
    <div>
    <select>
        <option>Company 1</option>
        <option>Company 2</option>
    </select>
    </div>
    <div>
        <input type="text" name="date">
    </div>
    <div>
        <input type="text" name="search">
        // Here is where I need to display the results from the db based on what the user typed in a drop down, then when that user selects that item then it will add that records id to an array. Then I need the array to display below and how the records based on the id. 
    </div>
    <div>
    // The array is shown here and as the user selects multiple items. It might look something like this
    <? $thisarray = array() - as users select items from drop down then the records ids are added to the array. Then as they are added to the array I can use a mysql SELECT to display those records. Then when the user submits the form I can pass that array as well.
    </div>
</form>

Please let me know if this makes sense. If not I will change my question

Cesar Bielich
  • 4,754
  • 9
  • 39
  • 81

1 Answers1

0

If your serial_number can be a string,maybe you can use the uuid (Universal Unique Identifier) with a prefix.

http://php.net/manual/en/function.uniqid.php

  • I have a following post which I have gotten farther in this quest to auto populate. Please follow this thread to get a better idea what I am referring to. http://stackoverflow.com/questions/14029029/auto-populate-list-with-ajax-mysql-and-javascript – Cesar Bielich Dec 25 '12 at 09:04