SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Inserting a row

  1. #1
    HI silver trophy Silverado4x4's Avatar
    Join Date
    Jan 2001
    Location
    USA
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Inserting a row

    How do I insert a new row through MySQL if that table is already made, and some data/rows are already there?

  2. #2
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the row all ready has some of the fields filled in, just use the update query:
    PHP Code:
    <?php
    //update database
    $update = @mysql_query(update <<tablename>> set <<field>>="whatever" and <<feild2>>="whatever" where <<id>>="something");
    ?>
    The "whatevers" are, of course, just the data that you want to input and the <<id>> is the primary key field that specifies to what row you want to add the data.

    Hope this helps.
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  3. #3
    HI silver trophy Silverado4x4's Avatar
    Join Date
    Jan 2001
    Location
    USA
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks.


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
  •