SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Feb 2001
    Location
    Shanghai, China
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have something where the user can enter a name and adress of all members of a group. Now I would like to know if it is possible to make a form where you can insert many persons in one step instead of inserting it person per person. So if I try this:
    INSERT INTO groups SET
    "nameofperson1"='$name', " .
    "nameofperson2"='$name', " .
    "nameofperson3"='$name', " .
    ....
    I get an error message that this is not possible.
    I'm sure there is any way to solve this problem, thanx, alex

  2. #2
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never actually done it but you should be able to do it this way

    INSERT INTO groups (name, address)
    VALUES ($name1, $address1), ($name2, $address2), etc ...

    Here's the link to the relevent chapter of the manual manual http://www.mysql.com/doc/I/N/INSERT.html

  3. #3
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    ... the relevent chapter of the manual manual
    As opposed to that new-fangled automatic manual.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  4. #4
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you making fun fun of me me?

    Well there you go - I didn't know I stuttered as I typed


Bookmarks

Posting Permissions

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