www.webdeveloper.com
Results 1 to 2 of 2

Thread: Mulitple Insert

  1. #1
    Join Date
    Feb 2006
    Posts
    11

    Question Mulitple Insert

    Hello,

    I have a mulitple select form:

    <select name="insert_value" size="4" multiple>
    <option value="value1">Option1</option>
    <option value="value2">Option2</option>
    <option value="value3">Option3</option>
    <option value="value4">Option4</option>
    </select>

    And an SQL INSERT statement:

    $query = "INSERT INTO table1 (field1) VALUES ('$insert_value')";
    mysql_query($query);

    How can I insert mulitple values from the select form into field1 in my database?
    --- ---

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    it looks like you're using php

    the select name should be named like an array, IE insert_value[]. Then you can loop through the values one item at a time to build the insert.
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles